Rmarkdown 图像跳过文本

标签 r latex knitr r-markdown

我正在将 Rmarkdown PDF 文档与以下 YAML 设置放在一起:

---
output: 
  pdf_document:
    fig_caption: true 
    fig_crop: true
    toc_depth: 3
  header-includes:
  - \usepackage{hyperref}
 ---

在文档正文中,我使用以下语法插入了一些 PNG 图像
Paragraph 1..........

![Caption](path/image.png)

Paragraph 2....

并且在呈现文档时,图像在文本中按预期显示在 Paragraph 1 之间。和 Paragraph 2 .但是,我得到了一些不可预测的结果,渲染图像出现在 Paragraph 2 之后。在某些情况下,我无法解决它。

最佳答案

我遇到了同样的问题。如果您将图像包裹在“段落”标签中,则图像将与文本对齐。

Paragraph 1...

<p>
![](image.png)
</p>

Paragraph 2...

关于Rmarkdown 图像跳过文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34145865/

相关文章:

python-2.7 - 升级后的python matplotlib更改了 latex 字体

python - matplotlib:将特殊数学符号添加到 xticklabels

r-markdown:德语引号将 HTML 文档中的粗体文本分隔开

r markdown vitae 包 "Undefined control sequence"编织到 vitae 预定义简历模板时出错

r - 如何在ggplot2中设置geom_smooth的se(置信区间)颜色?

read.delim() - 错误 "more columns than column names"和 "header and ' 'col.names"长度不同"

r - 在 Linux 中将 ggplot2 对象保存为 ggplotly 并保存到磁盘

mysql - 当通过批处理文件调用的脚本执行时,R 的 dbConnect 失败并显示 "DSN error"

r - 针织——! latex 错误 : File `figure/unnamed-chunk-1' not found

r - 字幕与文字混合