bookdown:LaTeX Error:包hyperref

时间:2018-05-28 05:08:41

标签: r latex bookdown

我知道“LaTeX错误:包hyperref的选项冲突。 “解决方案在https://tex.stackexchange.com/questions/279964/option-clash-for-package-hyperref 我使用了另一个tex模板'sjtuthesis.cls',它使用了包hyperref作为,

./sjtuthesis.cls:83:\RequirePackage[xetex, bookmarksnumbered, colorlinks, urlcolor=black, linkcolor=black, citecolor=black, plainpages=false, pdfstartview=FitH]{hyperref}

但是,bookdown也会自动添加包hyperref。 在https://github.com/rstudio/bookdown/tree/master/inst/examples生成的bookdown.tex文件中

./_book/bookdown.tex:25:\usepackage[unicode=true]{hyperref}
./_book/bookdown.tex:26:\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref

所以两行hyperref冲突。 我的意思是,如何避免自定义tex模板与bookdown内部使用的包之间的包冲突? 如何修改rmd文件?任何人都可以帮助我,谢谢你。

1 个答案:

答案 0 :(得分:1)

不幸的是,经常发生某个给定的类与rmarkdown使用的默认LaTeX模板不能很好地协同工作。你必须编写自己的模板,c.f。 Rmd to PDF compiling error: Package geometry \paperwidth (0.0pt) too short