Latexify.jl icon indicating copy to clipboard operation
Latexify.jl copied to clipboard

Issue rendering chemical reaction system in VSCode

Open gaurav-arya opened this issue 2 years ago • 2 comments

MWE (to be run in VSCode):

using Latexify, LaTeXStrings

latex_string = L"\begin{align*}
\require{mhchem}
\ce{ A &->[${\lambda}1$] B}
\end{align*}"

latexify(rn) |> s -> render(s, MIME("juliavscode/html")) 
latexify(rn) |> s -> render(s, MIME("image/png"))

Here, latex_string is the LaTeX output of a Catalyst chemical reaction: see https://github.com/SciML/Catalyst.jl/issues/566 for further discussion. The PNG output renderes correctly, but the juliavscode/html option (which is the default in VSCode) displays an error: image which seems to be due to the ${\lambda}1$ (which is valid LaTeX and accepted by the other mimes).

gaurav-arya avatar Nov 08 '22 23:11 gaurav-arya

I don't use VSCode, so I would need more specific instructions for how to test this out.

This is probably an error on MathJax's part.

gustaphe avatar Nov 22 '22 10:11 gustaphe

One needs to open up VSCode, create a file with content equal to that MWE, and run that file by pressing the triangle in the top right.

I agree it's probably a MathJax error. I posted it here because the juliavscode/html handling logic is in the source code of this repository -- do all the other MIME types not use MathJax? If so, then I guess it's just a bug with MathJax itself.

gaurav-arya avatar Nov 25 '22 01:11 gaurav-arya