我想产生一个RMD文件树形图我希望是这样的:错误43 pandoc:渲染RMD与rmarkdown包括乳胶配额树
使用rmarkdown的render
功能。
但是得到一个错误43我不知道如何解释。我怎样才能让pdf呈现?什么导致了错误?
RMD文件
---
title: "testtree"
header-includes:
- \usepackage{qtree}
output:
pdf_document
---
\Tree [.S [.NP LaTeX ] [.VP [.V is ] [.NP fun ] ] ]
Success
错误消息
> rmarkdown::render("testtree.Rmd", "all")
processing file: testtree.Rmd
|.................................................................| 100%
ordinary text without R code
output file: testtree.knit.md
"C:/Users/trinker/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS testtree.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output testtree.pdf --template "C:\R\R-3.2.2\library\rmarkdown\rmd\latex\default-1.14.tex" --highlight-style tango --latex-engine pdflatex --variable "geometry:margin=1in"
! Paragraph ended before \doanode was complete.
<to be read again>
\par
l.90
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Users/trinker/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS testtree.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output testtree.pdf --template "C:\R\R-3.2.2\library\rmarkdown\rmd\latex\default-1.14.tex" --highlight-style tango --latex-engine pdflatex --variable "geometry:margin=1in"' had status 43
>
以下.Rnw文件编译成功:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{qtree}
\begin{document}
Here is a code chunk.
\Tree [.S a [.NP {\bf b} c ] d ]
You can also write inline expressions, e.g. $\pi=\Sexpr{pi}$, and \Sexpr{1.598673e8} is a big number.
\end{document}
的'\ tree'命令可knitr文件。 –
这意味着LaTeX无法创建PDF ...先用'pdflatex'试试你的内联TeX ... – mb21
你可以使用'keep_tex:true'作为输出选项来排除故障。看起来有两个问题:1.你的表达式在我的常规tex文件中不起作用。我必须在每个右括号后添加新行,并且2. pandoc将最后两个右括号视为文字字符串,并将它们封装在{:{{}} {]}'中,而不是']]'中。 – scoa