小编Tho*_*rin的帖子

四开:根据输出格式运行不同的 R 代码

我有一个 qmd 四开文件,具有不同的输出格式:html 和 pdf。

我的目标是根据输出格式生成图形。

如何在 R 单元中检测处理输出格式是 html 还是 pdf?一个简单的 if 语句就足够了。

---
title: My title 
format:
  html:
    toc: true
    toc-depth: 3
    html-math-method: katex
  pdf:
    keep-tex: true
    toc: true
    number-sections: true
    colorlinks: true
---
Run Code Online (Sandbox Code Playgroud)

r quarto

6
推荐指数
1
解决办法
403
查看次数

标签 统计

quarto ×1

r ×1