# Is there a way to get katex global macros working?

#1

In the katex website it says global macros persist between math expressions: https://katex.org/docs/supported.html#macros

So in theory I could do:

$$\gdef\matrix#1{\begin{bmatrix}#1\end{bmatrix}}$$
$$\matrix{1&2&4\1&2&3}$$

But it doesn’t seem to work. The macro does work if it’s in the same expression. So:

$$\gdef\matrix#1{\begin{bmatrix}#1\end{bmatrix}} \matrix{1&2&4\1&2&3}$$

works. Is there a way of getting this working?

#2

Not sure but I’ve created an issue so that it will be checked - https://github.com/laurent22/joplin/issues/1105