# LaTeX rendering in the Julia REPL

**URL:** https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473
**Category:** General Usage
**Created:** [July 22, 2020, 5:05am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473 "2020-07-22T05:05:57Z")
**Posts on this page:** 13
**Page:** 2

<div class="post-metadata">

### Author: ![AshtonSBradley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashtonsbradley/32/11140_2.png) [@AshtonSBradley](https://discourse.julialang.org/u/AshtonSBradley)
#### Post date: [June 6, 2022, 2:16am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/21 "2022-06-06T02:16:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [June 6, 2022, 5:15am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/22 "2022-06-06T05:15:20Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![trilobit](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@trilobit](https://discourse.julialang.org/u/trilobit)
#### Post date: [June 6, 2022, 8:40am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/23 "2022-06-06T08:40:39Z")

</div>

Or simplify it 😉

```julia
using Latexify
render(latexify("4+5/(3-sqrt(36))"), MIME("juliavscode/html"))

```

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [June 6, 2022, 3:14pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/24 "2022-06-06T15:14:27Z")

</div>

```julia
ERROR: MethodError: no method matching display(::MIME{Symbol("juliavscode/html")}, ::String)

```

---

<div class="post-metadata">

### Author: ![trilobit](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@trilobit](https://discourse.julialang.org/u/trilobit)
#### Post date: [June 6, 2022, 7:12pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/25 "2022-06-06T19:12:28Z")

</div>

OS is Windows and MathJax is installed ?

 ![Untitled](https://global.discourse-cdn.com/julialang/original/3X/5/3/53890b753db4ccfdd42cfd2c49cac0c5661c460d.png)

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

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [June 6, 2022, 7:14pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/26 "2022-06-06T19:14:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)
#### Post date: [June 13, 2022, 4:24am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/27 "2022-06-13T04:24:17Z")

</div>

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

```julia-repl

julia> using Markdown

julia> using MarkdownLaTeXRender

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

```

---

<div class="post-metadata">

### Author: ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)
#### Post date: [June 13, 2022, 7:45am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/28 "2022-06-13T07:45:20Z")

</div>

Looks like VS code

---

<div class="post-metadata">

### Author: ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)
#### Post date: [June 13, 2022, 9:46am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/29 "2022-06-13T09:46:01Z")

</div>

![图片](https://global.discourse-cdn.com/julialang/original/3X/e/e/ee9003deec71c75578fa04bcc2752a7617ef1b21.png)

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [June 13, 2022, 10:05am UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/30 "2022-06-13T10:05:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [June 13, 2022, 12:02pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/31 "2022-06-13T12:02:12Z")

</div>

FWIW, one tool I know that does have the ability to show mathematical formulas in the terminal is [maxima](https://maxima.sourceforge.io/):

```julia
(%i1) integrate(f(x) / x, x, -1, 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.

---

<div class="post-metadata">

### Author: ![scheidan1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scheidan1/32/24771_2.png) [@scheidan1](https://discourse.julialang.org/u/scheidan1)
#### Post date: [June 26, 2024, 1:47pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/32 "2024-06-26T13:47:02Z")

</div>

A nice solution to the original question is [`LibTeXPrintf.jl`](https://github.com/JuliaStrings/LibTeXPrintf.jl) by @suavesito:

```julia
julia> texprintln("a = \\sum_i \\frac{1}{i}")
    ⎲ 1
a = ⎳ ─
    ⁱ i

```

It also accepts [`LaTeXString`](https://github.com/JuliaStrings/LaTeXStrings.jl)s.

---

<div class="post-metadata">

### Author: ![co1emi11er](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/co1emi11er/32/206849_2.png) [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)
#### Post date: [June 26, 2024, 4:17pm UTC](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473/33 "2024-06-26T16:17:52Z")

</div>

Cool. This works pretty well with Handcalcs.jl. I want to integrate a terminal mode with this.

```julia

julia> b = 5
5

julia> h = 15
15

julia> texprintln(
       @handcalcs begin
       Ix = b * (h)^3/12
       Iy = h * (b)^3/12
       end
       )
            b ⋅h³ 5 ⋅15³
       Ix = ───── = ────── = 1406.25
              12 12
$ h ⋅b³ 15 ⋅5³ $
 [10pt]Iy = ───── = ────── = 156.25
              12 12

```

Maybe there is a way to parse out the `$` and the `[10pt]`. That would be nice.

[Previous page](https://discourse.julialang.org/t/latex-rendering-in-the-julia-repl/43473.md?page=1)
