2014-09-12 18 views
5

LaTeX gặp sự cố khi tôi chạy nó trên đầu ra của tài liệu đan này vì các ký tự đặc biệt LaTeX không được thoát đúng cách. Bất kỳ gợi ý làm thế nào để sửa lỗi này?

\documentclass{beamer} 
\begin{document} 
\begin{frame}{Unescaped dollar signs and tildes} 

In this example, neither the tilde nor the dollar sign 
will appear in the pdf document, and the dollar sign 
will cause a \LaTeX error. 

<<xtable, results="asis">>= 
n <- 100 

x <- rnorm(n) 

y <- 2*x + rnorm(n) 

out <- lm(y ~ x) 

library(xtable) 

xtable(summary(out)$coef, digits=c(0, 2, 2, 1, 2)) 
@ 

\end{frame} 
\end{document} 

Trả lời

3

Bạn cần phải thêm [fragile] tùy chọn nếu khung của bạn có chứa một đoạn knitr với các nhân vật latex đặc biệt:

\begin{frame}[fragile] 

Nguồn: knitr webpage.

Các vấn đề liên quan