过去,我可以使用带有以下代码
的URL在r-markdown中渲染图像,但出现文件未找到错误! LaTeX Error: File https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark' not found
。
我会丢失包裹吗?该代码仍可在几个月前发布的一些闪亮应用程序上使用。
工作文件r-markdown文件下面:
---
title: "Test"
header-includes:
- \usepackage{graphicx}
output:
pdf_document:
latex_engine: xelatex
number_sections: yes
keep_tex: yes
classoption: article
papersize: A4
fontsize: 10pt
geometry: margin=0.9in
linestretch: 1.15
---
## R Markdown

答案 0 :(得分:2)
LaTeX graphicx 软件包不包含http客户端,因此无法从Internet提取图像。但是,从Markdown到LaTeX的许多转换工作都是由pandoc执行的,--extract-media
选项来告诉pandoc将所有图像存储在本地。当RMarkdown调用LaTeX时,它可以查找图像。
---
output:
pdf_document:
pandoc_args: ["--extract-media", "."]
---
以上内容将所有图像与Rmd文件存储在同一目录中。这些文件将使用SHA1哈希命名,因此您可能想为这些文件使用单独的目录。