我想產生一個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