【发布时间】:2019-05-20 16:29:33
【问题描述】:
我想在 R Markdown 中生成一个pdf_document2 PDF 文档,其中的表格和图形根据它们的节号进行标记。例如,第 2 节中的第一个图是图 2.1。我可以用html_document2 做到这一点,但不能用pdf_document2。
请参阅下面的代码,了解我编写的代码。现在,代码生成连续的图形编号(图 1、2、3、4),而不是图 1.1、1.2、2.1、2.2。
title: "Testing Section Numbers"
author: "Authors"
date: "January 2019"
output:
bookdown::pdf_document2:
fig_caption: yes
latex_engine: xelatex
number_sections: true
toc: yes
toc_depth: 2
editor_options:
chunk_output_type: console
link-citations: yes
linkcolor: blue
subparagraph: yes
citecolor: blue
urlcolor: blue
---
# R Markdown
```{r pressure1, echo=FALSE, fig.cap="This is my plot"}
plot(pressure)
```
```{r pressure2, echo=FALSE, fig.cap="This is my plot"}
plot(pressure)
```
# Including Plots
You can also embed plots, for example:
```{r pressure3, echo=FALSE, fig.cap="This is my plot"}
plot(pressure)
```
```{r pressure4, echo=FALSE, fig.cap="This is my plot"}
plot(pressure)
```
【问题讨论】:
标签: latex r-markdown bookdown