VSCode -- export of Jupyter Notebook & LaTeX math

I managed to install Python so that I can export HTML-files from VSCode/Jupyter Notebook to HTML – but export to PDF fails. I can get around this by opening the HTML file in MS Edge, and print to PDF from Edge – that seems to work fine.

There is a bug in the conversion from VSCode to HTML…

This is what my text looks like in VSCode/Jupyter Notebook:

and this is what it looks like in the HTML file that is generated:

  • Is there a way to get around this?

NOTE: When I open the file in IJulia instead of VSCode/Jupyter Notebook, IJulia has the same problem as the HTML file has, i.e., shows this textnormal\. string instead of the dot over the m…

Most of these tools are not using full LaTeX implementations, but rather are using things like MathJax that can render most LaTeX equations.

Probably they just don’t all support \textnormal. I would suggest editing your equations to use \dot{\mathrm{m}}_e instead (or \textrm), which is a more typical and widely supported way to render \dot{\mathrm{m}}_e in an equation.

(In particular, renderers like MathJax seem not to support \textnormal because there is no “normal text mode” in these packages — they are only for rendering LaTeX equations, not normal LaTeX text.)

PS. This has nothing to do with Unicode support (LaTeX ≠ Unicode), so I edited the title of your post accordingly.

1 Like

For what it’s worth, KaTeX supports \textnormal at least syntactically, and is available as a JupyterLab extension, but I’d go with the MathJax compatible solution too.

1 Like

Hm… I did not use \textnormal. I created

in ModelingToolkit by m\dot + TAB _e. Is there a better way to do it so that I can avoid \textnormal? The \textnormal command must have been inserted by latexify or something.

It comes from Latexify indeed:

julia> latexify(:(ṁ_e))

Related issue: Change the behavior of bar? · Issue #243 · korsbo/Latexify.jl · GitHub

1 Like