I have a bunch of custom math commands that I’d like to ba able to use in all my quarto documents.
Is there a way to include custom math commands in the quarto YAML header?
(for example, by pointing to a .sty file)
I think we actually need two external .sty files for this.
- One for LaTeX output, with bare math commands:
newcommand{e}{varepsilon}
- And one for mathjax output, surrounded by
(
and)
:
(
newcommand{e}{varepsilon}
)
Including those in the md or qmd file:
---
format:
pdf:
include-in-header: path/to/math_commands.sty
html:
include-before-body: path/to/mathjax_commands.sty
---
$$
e
$$
HTML output:
PDF output: