RyotaUshio / obsidian-mathjax-preamble-manager

Use preamble in Obsidian / switch preambles note to note
MIT License
19 stars 0 forks source link

Is it possible to use \usepackage in the preamble? #5

Closed dhark-y closed 3 months ago

dhark-y commented 3 months ago

I'm studying a subject, in chemistry, which I need to deal with Lewis structures. The Obsidian has been an amazing environment for me and definitely useful, but there is no native latex command that allows you to represent these structures in a simpler and "correct" way. To do this, it would be necessary to use the "chemfig" package. Would it then be possible to use it?

RyotaUshio commented 3 months ago

Short answer: You can load packages with \require rather than \usepackage, but probably chemfig is not supported.


Obsidian uses MathJax, not LaTeX. MathJax is a library that allows us to mimic a subset of the actual LaTeX, so some aspects are not supported.

MathJax supports external packages via \require{package_name} instead of LaTeX's \usepackage{package_name}. However, not all latex packages have been rewritten for MathJax.

Unfortunately, chemfig is seemingly not supported in MathJax: see https://docs.mathjax.org/en/latest/input/tex/extensions/index.html for the list of the supported packages.

See also: https://github.com/mathjax/MathJax/issues/554

(mhchem is supported though)