本文介绍了R 注释中的动态 LaTeX 引用与 knitr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我曾就 Sweave
提出过类似的问题(动态引用 Sweave 文档中 R 注释中的图形) 并想看看是否有人在使用 knitr
时有类似的答案.
<<"example", fig.cap = "some figure", highlight = FALSE>>=
# the following code generated Figure
ef{fig:example}
plot(1:10, 1:10)
@
have be displayed in the resulting .pdf as
# the following code generated Figure 1.1
plot(1:10, 1:10)
推荐答案
我添加了一个例子 knitr-examples 存储库中的 .Rnw" rel="nofollow">072-latex-reference.Rnw.基本思想是恢复转义的ef{}
(在默认输出中应该是extbackslash{}ref{}
).
I have added an example 072-latex-reference.Rnw in the knitr-examples
repository. The basic idea is to restore the escaped ef{}
(which should have been extbackslash{}ref{}
in the default output).
这篇关于R 注释中的动态 LaTeX 引用与 knitr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!