我希望段落中的代码与代码块中显示的代码一致。
例如:
<p>
The formula method for a linear model
is <code>lm(y~x, data = dat)</code>.
For our data the results are:
</p>
<!--begin.rcode
lm(y~x, data = dat)
end.rcode-->
<code>
使用除内联之外的其他东西并获得与块代码相同的格式会很好。
我正在使用knitr
:
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
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
[6] methods base
other attached packages:
[1] knitr_1.2
loaded via a namespace (and not attached):
[1] digest_0.6.3 evaluate_0.4.3 formatR_0.7
[4] stringr_0.6.2 tools_3.0.1
谢谢,
最大限度