有没有办法在 Sweave 中为注释/代码着色?

发布于 2024-12-02 17:15:34 字数 88 浏览 0 评论 0原文

我发现我可以通过在 \SweaveOpts 中指定 keep.source 在 Sweave 代码块中保留注释,但是有没有办法让代码列表看起来像灰色注释一样漂亮?

I found that I can keep comments in the Sweave code chunks by specifying keep.source in the \SweaveOpts, but is there a way to make the code listing look nice like with grayed out comments?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等待圉鍢 2024-12-09 17:15:34

范德比尔特大学生物统计系 sweave 模板网站上展示了多个选项:http://biostat。 mc.vanderbilt.edu/wiki/Main/SweaveTemplate

我发现 Swavevel 风格是最灵活的。

突出显示包是另一种选择。

There are several options illustrated at Vanderbilt University's Department of Biostatistics sweave templates site: http://biostat.mc.vanderbilt.edu/wiki/Main/SweaveTemplate

I found the Sweavel style to be the most flexible.

The highlight package is another option.

め七分饶幸 2024-12-09 17:15:34

pgfSweave 包可以生成语法高亮的代码。

the pgfSweave package can produce syntax-highlighted code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文