【发布时间】:2015-04-18 12:36:23
【问题描述】:
我正在使用rmarkdown 的函数render() 和knitr 的函数spin() 从R 脚本生成html 和pdf 笔记本。有时我使用嵌套列表并将它们与代码块混合。这是一个使用 rmarkdown 和 knitr 块选项的示例。
#' (1) This is normal text.
#' (a) This is normal text but indented.
#+ echo = TRUE, eval = TRUE
print("This is code")
#' (b) This is supposed to be normal text with the same
#' indentation as (a). However, it will be formatted as code.
#' By this I mean that e.g. in a pdf-notebook it will be
#' correctly indented but the font will be the same font as
#' the code.
但是,列表项 (a) 之后的代码后面的所有内容也将标记为代码(例如 (b))。但我想要实现的是将 (b) 标记为普通文本并使用与 (a) 相同的缩进。可以这样做吗?
【问题讨论】:
标签: r markdown knitr r-markdown