LaTeX rendering in the Julia REPL

especially now that github markdown supports latex. If you do ?ModuleName and there are no docstrings, you get the readme. If the repl .md could render latex that would be cool

GitHub markdown supports what now? That’s very exciting.

I’m not sure what it would mean for the repl to render LaTeX, it’s not something that I would expect to be possible in most terminal emulators. Maybe a layer that translates \mu into μ, (i.e. a tex2utf8 engine) but that seems like you’d be crossing the river for water.

1 Like

Or simplify it :wink:

using Latexify
render(latexify("4+5/(3-sqrt(36))"), MIME("juliavscode/html"))
ERROR: MethodError: no method matching display(::MIME{Symbol("juliavscode/html")}, ::String)

OS is Windows and MathJax is installed ?

Test MathJax:
Point with mouse at the output and click right mouse-button, then the MathJax contextmenu should
be displayed.

That is not the repl. It appears to be some IDE.

I made something that does this for LaTeX bits of docstrings.

julia> using Markdown

julia> using MarkdownLaTeXRender

julia> md"Hey ``\sum \mathbb{x}^2-\frac{1}{2}\sigma``"
  Hey ∑ 𝕩² − ¹/₂σ
1 Like

Looks like VS code

1 Like

That’s also an (the same?) IDE. Still not the repl.

FWIW, one tool I know that does have the ability to show mathematical formulas in the terminal is maxima:

(%i1) integrate(f(x) / x, x, -1, 1);
                                 [    f(x)
(%o1)                            I    ---- dx
                                 ]     x
                                  - 1

I have absolutely no idea how they do this, and whether it would be doable to get inspiration from the maxima code to have something similar in Julia.

1 Like