目录未在Rmarkdown pdf创建中更新

时间:2015-09-16 20:22:31

标签: pdf yaml knitr r-markdown tableofcontents

由于某种原因,我在Rstudio中从Knit.pdf创建的pdf的TOC没有更新。它正在创建,但有一些过去的信息(在第68页停止,我已经在第99页)。

可能与缓存信息有关吗?

在YAML前言下面我使用并检查了Knitr Edit R markdown配置下的“include table of contents”选项。通过下面的YAML,也尝试使用toc:true在pdf_document下面并且没有用。

title: "My book"
author: "MyName"
date: "Mydate"
documentclass: book
fontsize: 10pt
classoption: 
        b5paper
header-includes:
   - \usepackage{tcolorbox}
   - \usepackage{longtable}
   - \usepackage{sidenotes}
   - \renewcommand{\contentsname}{MyContent}
   - \renewcommand{\chaptername}{MyChapter}
 geometry:
  - tmargin=2cm
  - bmargin=2cm
  - lmargin=2cm
  - rmargin=2cm
toc: yes
output: 
  pdf_document:
     fig_caption: yes
     highlight: zenburn
     latex_engine: xelatex
     number_sections: yes
     pandoc_args: --chapters
     toc: yes
     toc_depth: 3

1 个答案:

答案 0 :(得分:0)

是否与toc被调用两次有关,一次在输出之前,然后再在pdf文档之下?

yaml :: yaml.load(enc2utf8(string),...)中的错误:   重复的地图键:'toc' 电话:... yaml_load_utf8 - > mark_utf8 - > - > 。呼叫 执行暂停

相关问题