如何在不使用节编号的情况下使rmarkdown文档成为一部分? [英] How to make part of rmarkdown document without section numbering?

查看:114
本文介绍了如何在不使用节编号的情况下使rmarkdown文档成为一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rmarkdown文档(.Rmd),我想将其编织为pdf文档. number_sections已设置为"yes",toc已设置为"true".如何添加出现在目录中但没有节号的附录节?

I have an rmarkdown document (.Rmd) that I want to knit into a pdf document. number_sections has been put to 'yes' and toc to 'true'. How can I add appendix sections that appear in the table of contents but don't have a section number?

这是一个示例.Rmd代码.如何让附录A和附录B为无数部分,并使它们同时出现在目录中?

Here is an example .Rmd code. How can I let appendix A and appendix B be numberless sections and let them appear in the table of contents at the same time?

---
title: "Test"
author: "test test"
geometry: margin=1in
output:
  pdf_document:
    keep_tex: yes
    latex_engine: xelatex
    number_sections: yes
    toc: yes
    toc_depth: 3
header-includes:
- \usepackage[dutch]{babel}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LE,RO]{this is a fancy foot}
- \usepackage{dcolumn}
- \usepackage{here}
- \usepackage{longtable}
- \usepackage{caption}
- \captionsetup{skip=2pt,labelsep=space,justification=justified,singlelinecheck=off}
subtitle: test test test
fontsize: 12pt
---
# start

# second

```{r results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA,fig.height=4}
cat("and here some R")
```

# appendix A

# appandix B

推荐答案

只需在节名称后添加{-}.因此,对于您的附录,您应该执行以下操作:

Just add {-} after the section name. Thus, for your appendices, you should do something like:

# appendix A {-}

# appendix B {-}

有关更多详细信息,请参阅文档的本节.

For more details, see this section of the docs.

结果:

这篇关于如何在不使用节编号的情况下使rmarkdown文档成为一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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