0

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)?

1 Answer 1

0

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:
html output

PDF output:
pdf output

Not the answer you're looking for? Browse other questions tagged or ask your own question.