knitr和数字标题(更新问题?)

时间:2015-10-09 23:42:07

标签: r latex knitr

我想在图中标题,在图表列表中出现的短标题,并参考文中的图。这似乎对我来说非常有用,而且从我阅读文档here它应该仍然有用。令我沮丧的是,我得到一个空的数字列表,一个没有标题的数字,以及一个?在文中。我正在通过点击“编译PDF”按钮在RStudio中编译。

我错过了一些明显的东西吗?

\documentclass{article}
\usepackage{graphics}

\begin{document}
\SweaveOpts{concordance=TRUE}

\listoffigures

I'm referring to Figure~\ref{fig:wtf}.

<<wtf,echo=FALSE,fig=TRUE,fig.cap='test caption',fig.scap='tstcptn'>>=
plot(rnorm(1000))
@

<<si>>=
sessionInfo()
@

\end{document}

我最近更新到R和RStudio的最新版本。以下是文档中sessionInfo()的结果。

R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
loaded via a namespace (and not attached):
[1] tools_3.2.2

cat(system('pandoc --version', intern=TRUE), sep = '\n')的结果是

pandoc 1.15.0.6
Compiled with texmath 0.8.2.2, highlighting-kate 0.6.
...

我想不出任何其他信息要提供......

0 个答案:

没有答案