0

我希望我的 rmd 文件根据我是编译为 html 还是编译为 pdf 运行不同的代码。

更具体地说,我想加载 latex package enclose。如果我想编译成 html,我使用命令$$\require{enclose}$$. 如果我想加载到 pdf,我会进入我的 yaml 并使用header-includes: \usepackage{actuarialangle}.

如果我可以根据编译方法运行不同的代码,enclose那么我不仅可以在编译为 HTML 时加载,而且还可以定义我的宏以使用正确的函数(fromactuarialangleenclose)。

4

0 回答 0