将pandoc中的文档转换错误从Rmd转换为pdf

时间:2018-04-23 12:31:19

标签: r pdf r-markdown knitr pandoc

我刚刚将pandoc 1.9.x更新为pandoc 2.1.3,并准备好自杀这样做。在更新之前,将.Rmd转换为.pdf输出的过程非常顺利。我确实使用自定义.tex和样式模板以及thesisdowndss包进行编织。

编织顺利并产生.md(虽然这是暂时的,因此我无法访问它)但是pandoc转换失败并伴随着输出。

output file: thesis.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS thesis.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis.tex --table-of-contents --toc-depth 3 --template template.tex --number-sections --highlight-style pygments --pdf-engine pdflatex --chapters --variable tables=yes --standalone --filter pandoc-citeproc 
--chapters has been removed. Use --top-level-division=chapter instead.
Try pandoc.exe --help for more information.
Error: pandoc document conversion failed with error 2
In addition: There were 33 warnings (use warnings() to see them)
Please delete thesis.Rmd after you finish debugging the error.
Execution halted

可以看出,控制台错误输出非常缺乏信息。我的问题是:如何访问pandoc写入的日志?我感到无助,因为没有中间的.md文件可以试验。

另一个问题是,我找不到一个pandoc 1.9.x窗口二进制文件了,虽然github提供了一个source,编译它来获得一个现成的不是我的选择。任何人都可以指出我阅读使用pandoc的二进制版本(我认为这可以节省我一些时间,因为提交截止日期即将到来)?

希望完整的标题更明智,这里是:

---
author: 'Dear Dog'
date: "`r Sys.Date()`"
institution: 'Uninstitutional'
division: 'Hooligan'
advisor: 'pre-professor'
department: 'Blah Blah'
degree: 'Masters of Undiagnosis'
title: "Panic attack due to pandoc error"
knit: "bookdown::render_book"
site: bookdown::bookdown_site
output: 
  thesisdowndss::thesis_pdf: default
keep_md: true
abstract: |
  `r if(knitr:::is_latex_output()) paste(readLines("00-abstract.Rmd"), collapse = '\n  ')`
acknowledgements: |
  I am in no situation to acknowledge the resolution, right now.
bibliography: ["bib/thesis.bib", "bib/exported_items.bib"]
csl: csl/apa.csl
lot: true
lof: true
space_between_paragraphs: true
header-includes:
- \usepackage{tikz}
- \usepackage{array}
- \usepackage{multirow}
- \usepackage{wrapfig}
- \usepackage{colortbl}
- \usepackage{pdflscape}
- \usepackage{tabu}
- \usepackage{threeparttable}
- \usepackage[normalem]{ulem}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
- \usepackage{subcaption}
- \newcommand{\subfloat}[2][need a sub-caption]{\subcaptionbox{#1}{#2}}
---

2 个答案:

答案 0 :(得分:1)

由于这是预订,我在另一个答案中建议的keep_md: true参数不起作用。相反,您可以运行render("thesis.Rmd", clean = FALSE)来保留中间文件。

答案 1 :(得分:0)

要保留中间.md文件,您可以将以下内容添加到YAML标题中:

keep_md: true