Add MathJax physics package preamble option for tex equations

Use case or problem

The MathJax loader supports packages on runtime, two of which are mchem and physics. I’m an engineering student and find it quite irritating that there’s no option to customize the default equation preamble for obsidian mathjax.
Because of this, symbols such as /gradientnabla or very convenient shortcuts such as \pdv which replaces partial derivatives instead of having to type \dfrac{\partial f}{\partial x} etc… are unavailable unless we manually type \require{physics}

Proposed solution

In the javascript of the mathjax instance, a simple toggle adds in \require{physics}\displaystyle to every equation or we get a field that adds the preamble we type to all equations. It wouldn’t be hard at all to implement and it lets people use the full set of features of the mathjax parser without having to type the required preamble everytime.

Current workaround (optional)

just typing it by hand lol

1 Like

Have you read this?
physics — MathJax 3.2 documentation