Any way to let Katex Plugin ignore "amp;" from html code?

Im using BJ’s WYSIWYG HTML editor plugin for math notes, however the Katex plugin keeps rendering “&” as “amp;” due to the nature of html code:

Is there a way to modify the Katex plugin such that it ignores the “amp;” portion from html?

Are you using it in an align environment?

The katex docs says \& or you could put it in \text{&}

How does it look without BJ’s wizywig?

In the align environment, “&” gives separation between elements of the same row. But under html it renders the “amp;” parts into the text. In markdown environment this is what it should look like

I use align environment in tiddlywiki without a problem.

$$\begin{aligned}
\displaystyle
M_{max}& = \frac{20000\times12}{4} \\
M_{max}&=60000Nm \\
M_{max}&=60kNm \\
\end{aligned}$$

For example here

Is this a wrinkle in BJ’s Wizywig?

It’s a html problem, mainly because in html “&” is written as “&” in source code. Thats the nature of html, so when Katex reads the source code, it takes the “&” part and leaves “amp;” behind.

I suppose the only way to change how things get rendered is to edit the plugin itself? (I don’t know)

Are you using Katex plugin in tiddler with markdown type?
I don’t know if the plugin work in markdown tiddlers and if the markdown supports katex(/latex) blocks (or only it isn’t supported in the markdown implemented in tiddlywiki)

Oh Markdown works just fine. The problem comes when html codes are used instead of the embedded markdown editor

Mmmm If you need decoded html then you use decodehtml operator.

The following snippet works in https://tiddlywiki.com/plugins/tiddlywiki/katex/

\define formula_source() \begin{vmatrix} a & b & c \end{vmatrix}

<$let myFormula={{{ [<formula_source>decodehtml[]] }}} >
<$latex text=<<myFormula>> ><$latex/>
<$/let>

You could use something similar to it.

It works! Thank you! :slight_smile: