【发布时间】:2019-06-17 19:44:38
【问题描述】:
我有一份报告(pdf 输出),我想在其中将参考书目、图表列表和表格列表添加到附录中。我希望这三个元素出现在目录中。
我通过将bibliography: bibliography.bib 添加到我的 yaml 标头来添加 参考书目。我直接用 LaTex 添加的图形列表和表格列表。
因此,我的附录看起来像:
# Literature {-}
\listoffigures
\listoftables
这几乎有效:参考书目、图表列表和表格列表正确呈现。
唯一的问题是,目录只显示一个条目文学。图表列表和表格列表不显示。
我该如何解决这个问题?
我尝试在 yaml 标头的各个位置使用 lof: yes 和 lot: yes(想法来自 here 以及 toc_appendix: yes(来自同一来源)
我错过了什么?
我的完整标题如下所示:
---
title: something
header-includes: \usepackage{graphicx} \usepackage{float} \usepackage{xcolor} \usepackage{framed} \usepackage{longtable} \definecolor{shadecolor}{RGB}{240,240,240} \pagenumbering{roman} \usepackage{caption} \captionsetup{font=footnotesize}
output:
bookdown::pdf_book:
fig_caption: yes
highlight: kate
number_sections: yes
toc: yes
date: |
|
| `r format(Sys.time(), '%B %d, %Y')`
documentclass: report
geometry: margin=1in
fontfamily: mathpazo
fontsize: 11pt
bibliography: bibliography.bib
preamble: |
% Any extra latex you need in the preamble
---
【问题讨论】:
-
在自己的行中使用
--- output: bookdown::pdf_document2 toc: yes lof: yes lot: yes ---和每个参数对我来说效果很好。 -
@MartinSchmelzer:谢谢您的回复。那也是我的第一次尝试。奇怪的是我收到一个错误:
Error in base_format(toc = toc, number_sections = number_sections, fig_caption = fig_caption, : unused arguments (lof = TRUE, lot = TRUE)。你知道可能是什么问题吗? -
@MartinSchmelzer:为了完整起见,我添加了标题。我尝试在
toc: yes下方插入lof: yes和lot: yes,但没有成功。我也将pdf_book更改为pdf_document2,但没有成功。 -
@MartinSchmelzer 奇怪,我可以重现错误。看起来像一个错误?
-
问题出在文档类上。如果您删除此行,它会起作用。如果您需要使用报表文档类,请将
\usepackage[nottoc]{tocbibind}添加到您的包含中。
标签: r markdown r-markdown bookdown