如何在xaringan演示文稿中为单张幻灯片禁用highlightSpans功能
xaringan单幻灯片关闭highlightSpans的方法
- 方案1:整页覆盖配置
在目标幻灯片的标题末尾添加data-nature属性,直接覆盖全局nature配置,仅对当前页生效,示例代码如下:
--- # 代码展示页标题 {data-nature='{"highlightSpans": false}'} I did a lot of work and the p-value was `r round(results[[5]][1], 2)` and this made me sad. ---
配置后当前页所有反引号都不会触发高亮,会完全原样展示,其他幻灯片仍沿用全局highlightSpans: true的设置。
- 方案2:局部转义反引号
如果仅需要展示少量带反引号的内容,不需要关闭整页高亮,可以用双反引号包裹需要原样展示的单反引号片段,写法如下:
I did a lot of work and the p-value was `` `r round(results[[5]][1], 2)` `` and this made me sad.
无需修改页面配置即可实现单个反引号片段的原样展示,不影响页面其他内容的高亮效果。
内容的提问来源于stack exchange,提问作者itsMeInMiami
相关产品推荐
相关产品推荐

