%我的是可以的。使用Rstudio及knitr。感谢上面的提示。另外,为对付中文,我使用了ctexbook,ccmap,以及pdf.options(family='GB1'),保存时,选编码为CP936(System default)。经过这一番折腾,终于可以在chunk中使用中文了,坐标中也可。
\documentclass[hyperref,a4paper]{ctexbook}
\usepackage[body={16cm,22cm}, top=3cm]{geometry}
\usepackage{indentfirst}
%\geometry{papersize={21.59cm,27.94cm}}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{ccmap}
\begin{document}
\section{处理中文问题}
只要使用一个参数即可解决中文问题,即pdf.options(family='BG1')。太好了。见生成的图\ref{fig:example_cn}。另外,使用warning=F,将错误提示不再显示即可。Rnw文档保存时,要选编码即CP936(System default)。
<<example_cn,fig.cap='图中显示中文,包括坐标',echo=TRUE,fig=TRUE,warning=FALSE>>=
pdf.options(family='GB1')
x <- rnorm(100)
y <- rnorm(100)
plot(x, y, main='chinese中文', xlab="中文", ylab="中文")
@
\end{document}