Rmarkdown图像跳过文本前面 [英] Rmarkdown Image Skips Ahead of Text

查看:76
本文介绍了Rmarkdown图像跳过文本前面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am putting together an Rmarkdown PDF document with the following YAML settings:

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

在文档正文中,我使用以下语法插入了几张PNG图片

Within the body of the document I've inserted a few PNG images, using the following syntax

Paragraph 1..........

![Caption](path/image.png)

Paragraph 2....

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

And when the document is rendered, the image appears as expected within the text, between Paragraph 1 and Paragraph 2. However, I am getting some unpredictable results where the rendered image appears after Paragraph 2 in some cases and I can't manage to solve it.

推荐答案

我遇到了同样的问题.如果将图像包装在段落"标签中,则会出现该图像,该图像将与文本对齐.

I have run into the same problem. It appears if you wrap the image in "paragraph" tags, the image will be in-line with the text.

Paragraph 1...

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

Paragraph 2...

这篇关于Rmarkdown图像跳过文本前面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆