# How to display a LateXString in pluto?

**URL:** <https://discourse.julialang.org/t/how-to-display-a-latexstring-in-pluto/135230>\
**Category:** Pluto\
**Tags:** latexstrings\
**Created:** [January 23, 2026, 4:54pm UTC](https://discourse.julialang.org/t/how-to-display-a-latexstring-in-pluto/135230 "2026-01-23T16:54:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [January 23, 2026, 4:54pm UTC](https://discourse.julialang.org/t/how-to-display-a-latexstring-in-pluto/135230/1 "2026-01-23T16:54:00Z")

</div>

I have my type of objects `Mvp` (for “multivariate polynomials”) and I have overloaded `latexstring` for them. For example, for a certain polynomial `p` I have at the repl:

```julia-auto
julia> latexstring(p)
L"$x^3+3x^2y+3xy^2+y^3$"

```

If in Pluto I evaluate `latexstring(p)` I get a nice display. So I want that whenever I evaluate an `Mvp`, it is displayed in Pluto via its `latexstring`. I thought the following would do the job:

`Base.show(io::IO,::MIME"text/html",p::Mvp)=print(io,latexstring(p))`

and for instance it works perfectly in an `IJulia` notebook. But it does not work in Pluto, it shows the unrendered string. What is the solution?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 23, 2026, 7:01pm UTC](https://discourse.julialang.org/t/how-to-display-a-latexstring-in-pluto/135230/2 "2026-01-23T19:01:41Z")

</div>

> [@Jean\_Michel](#):
>
> a notebook. But it does not work in Pluto, it shows the unrendered string. What is the solution?

For some reason Jupyter automatically interprets `$...$` inside HTML as LaTeX and renders it with MathJax:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/7/d7529d00ef0d8288e73489b6cd68e687f3e84c02.png)

However, in general I wouldn’t expect HTML rendering to do this, so it’s not so surprising that it doesn’t work in Pluto. I think you need to display in a format like `text/latex` or `text/markdown` that [Pluto supports](https://github.com/JuliaPluto/Pluto.jl/blob/main/src/runner/PlutoRunner/src/display/mime%20dance.jl) and which should should handle LaTeX equations, i.e.

```julia-auto
Base.show(io::IO, ::MIME"text/latex", p::Mvp) = print(io, latexstring(p))

```

---

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [January 23, 2026, 10:05pm UTC](https://discourse.julialang.org/t/how-to-display-a-latexstring-in-pluto/135230/3 "2026-01-23T22:05:53Z")

</div>

> [@stevengj](#):
>
> `Base.show(io::IO, ::MIME"text/latex", p::Mvp) = print(io, latexstring(p))`

Thank you for the tip!  
This works _after_ deleting the method `Base.show(io::IO, ::MIME"text/html", p::Mvp)` which seems to be preferentially called
