knitr編譯並生成pdf文件,但由knitr生成的tex文件不能編譯(使用livetex)使用texlive,爲什麼我可以將knitr Rnw文件編譯爲pdf而不是從編織R輸出到pdf
這裏是test.Rnw
\documentclass[letter]{article}
\title{y}
\author{z}
\begin{document}
\maketitle
<<assignment, echo = TRUE>>=
(X <- 10)
@
\end{document}
下產生pdf文件:texi2pdf(file = "test.tex", clean = TRUE)
由knitr產生的reamble有一個問題:
\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
\def\[email protected]@[email protected]{}%
\ifinner\ifhmode%
\def\[email protected]@[email protected]{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\[email protected] \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\[email protected]@[email protected]}
\makeatother
下面是錯誤:
\begin{minipage} does not have matching end; at least one unbalanced
begin-end test.tex /tests-R line 39 Problem
\end{minipage} found with no preceding \begin test.tex /tests-R line 38
出於顯而易見的原因,至少有一個出版商希望TEX文件,而不是RNW文件
無法在我的機器上重現此操作。什麼是livetex? – EDi
無法在我的機器上重現。 Ubuntu 13.10 + TeXLive 2013. –
同上Ubuntu 12.04 TeXLive 2009 –