Support preamble.sty / custom LaTeX preamble in Obsidian Publish

Use case or problem

Obsidian Publish currently renders MathJax, but it does not support loading a custom LaTeX preamble such as preamble.sty. This creates a gap between the local Obsidian experience and the published site for users who rely on custom macros, theorem environments, operators, or shared notation across notes.

For users with math-heavy vaults, this means:

  • notes that work locally do not render correctly on Publish

  • repeated boilerplate is required in every note

  • maintaining large sets of formulas becomes fragile and tedious

  • Publish is less viable for academic, technical, and research content

In practice, this makes it hard to publish any vault that depends on reusable LaTeX definitions.

Proposed solution

Add support in Obsidian Publish for a vault-level custom LaTeX preamble.

This would make Publish much more usable for technical and academic users, while reducing duplication and improving parity with local Obsidian workflows.

Current workaround (optional)

None that I know of :frowning:

1 Like

Wondering if/how I can add macros to publish.js so that I can make up for MathJax’s deficiencies. For one:
\iddots $\kern3mu\raise1mu{.}\kern3mu\raise6mu{.}\kern3mu\raise12mu{.}$, the counter-diagonal cousin to \ddots $\ddots$, the typical main-diagonal dots. I know that is not standard latex, so I would like a macro. I have seen this script

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
Macros: {
  iddots: "{\\kern3mu\\raise1mu{.}\\kern3mu\\raise6mu{.}\\kern3mu\\raise12mu{.}}"
}}});
</script>

Is this the correct syntax? Can I add this to publish.js?
(I don’t know anything about how publish.js works because I couldn’t find documentation for it anywhere)