I'm looking to have my rmd file run different code depending on whether I'm compiling to html or compiling to pdf.
More specifically, I want to load the latex package enclose
. If I want to compile to html, I use the command $$\require{enclose}$$
. If I want to load to pdf, I go into my yaml and use header-includes: \usepackage{actuarialangle}
.
If I can run different code depending on the compilation method, not only could I load enclose
if I am compiling to HTML, but I can also define my macro to use the correct function (from actuarialangle
or enclose
).