简体   繁体   English

如何使用RStudio(knitr?)回到图像标题的简单Markdown格式?

[英]How Do I Get Back to a Simple Markdown Format for Image Captions Using RStudio (knitr?)?

I just updated several R packages and it seems to have introduced breaking changes in the production of markdown interim output from Rmd documents in RStudio. 我刚刚更新了几个R软件包,它似乎引入了RStudio中Rmd文档的markdown临时输出产生的重大变化。

Assuming knitr is still used by RStudio to generate md from Rmd on the way to producing html , expressions of the form: 假设在生成html ,RStudio仍然使用knitrRmd生成md ,表达式如下:

---
output:
  html_document:
    keep_md: yes
---
```{r myimg, fig.cap="My caption"}
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
```

that used to render something of the form: 曾经用于渲染形式的东西:

![My caption](myimg.png)

now get rendered in the markdown as: 现在在降价时呈现为:

<div class="figure">
<img src="myimg.png" alt="My caption"  />
<p class="caption">My caption</p>
</div>

which is not what I want at all. 这根本不是我想要的。

How do I the original, simpler md formatting back? 我如何将原始的,更简单的md格式化回来?

This issue has been fixed in knitr (>= 1.12.6) currently on Github . 此问题已在目前Github上的knitr (> = 1.12.6)中修复 I was writing out the HTML code for images to support another package that I was working on, and I should have enabled this only conditionally. 我正在写出图像的HTML代码,以支持我正在处理的另一个包,我应该只是有条件地启用它。 Now you should be able to see the original ![]() syntax in the Markdown output. 现在,您应该能够在Markdown输出中看到原始的![]()语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM