【问题标题】:Table of Contents not being updated in Rmarkdown pdf creationRmarkdown pdf创建中未更新目录
【发布时间】:2015-12-13 14:15:06
【问题描述】:

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

可能与缓存信息有关吗?

在我使用的 YAML 序言下方,还检查了 Knitr Edit R 降价配置下的“包含目录”选项。通过下面的 YAML,也尝试在 pdf_document 下面使用 toc:true 并且没有工作。

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

【问题讨论】:

  • 如果你的工作目录下有filename.toc文件,请尝试删除后重新编译。
  • @user2706569:完成。它确实存在一个 .toc 文件,但即使删除后表也没有更新。

标签: pdf yaml knitr r-markdown tableofcontents


【解决方案1】:

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

yaml::yaml.load(enc2utf8(string), ...) 中的错误: 重复的地图键:'toc' 调用:... yaml_load_utf8 -> mark_utf8 -> -> .Call 执行停止

【讨论】:

  • @Chaitnaya。不是不是...实际上我已经意识到并删除了第一个。在@ user2706569之后,我试图在工作目录中找到任何可能相关的文件并删除2或3个奇怪的input.something文件....现在看来它正在工作,虽然我不知道到底发生了什么。谢!!
猜你喜欢
  • 2016-01-29
  • 2021-06-28
  • 2021-12-10
  • 2011-02-03
  • 1970-01-01
  • 2018-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多