# Pluto: how to insert a table from LaTeX code into markdown

**URL:** <https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481>\
**Category:** General Usage\
**Tags:** pluto-and-latex\
**Created:** [May 3, 2021, 6:58pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481 "2021-05-03T18:58:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [May 3, 2021, 6:58pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/1 "2021-05-03T18:58:15Z")

</div>

Pluto is wonderful and I am trying to pass all my slides into Pluto notebooks. A large part of my slides are written in LaTeX and I am struggling with this part in Pluto.

For example, I have this table in LaTeX:

```julia
$$
\begin{aligned}
& \text {Table 1.1. A Jupyter notebook table using LaTeX }\\
&\begin{array}{cccc}
\hline \hline \text { Case } & \text { Method 1 } & \text { Method 2 } & \text { Method 3 } \\
\hline 1 & 50 & 837 & 970 \\
2 & 47 & 877 & 230 \\
3 & 31 & 25 & 415 \\
4 & 35 & 144 & 23656 \\
5 & 45 & 300 & 556 \\
\hline
\end{array}
\end{aligned}
$$

```

If compiled in a LaTeX editor or in a Jupyter notebook leads to

![aa_table](https://global.discourse-cdn.com/julialang/original/3X/d/c/dcd8d2aaffee4d684c55624d1c14633537d3022b.png)

It looks like such a simple thing, but I have not been able to have it displayed on Pluto. Help will be very much appreciated.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [May 3, 2021, 7:08pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/2 "2021-05-03T19:08:52Z")

</div>

It just works if you put the `$$` and the `\begin...` and the `\end{aligned}` and the final `$$` in the same line, like: `$$\begin{aligned} ... \end{aligned}$$`.

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [May 3, 2021, 7:30pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/3 "2021-05-03T19:30:42Z")

</div>

@lmiq You just keep saving my skin. I think I had tried your advice before, but I failed (maybe a stupid typo). Then I tried the option

![aa](https://global.discourse-cdn.com/julialang/original/3X/a/c/ac5216eee1685baacff3b3a3fab32aeb303974b8.png)

which I have seen people using for equations, but failed. As usual, your suggestion works! When we meet, I’ll pay you a lunch.

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [May 3, 2021, 7:43pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/4 "2021-05-03T19:43:48Z")

</div>

@lmiq By the way, do you have any idea how to auto numerate equations in LaTeX mode and using cross-ref in Pluto? I have raised an issue already about this, but apparently, nobody came up with a solution.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [May 3, 2021, 7:46pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/5 "2021-05-03T19:46:37Z")

</div>

> [@VivMendes](#):
>
> I have raised an issue already about this, but apparently, nobody came up with a solution.

I think currently there is none. There is an issue open somewhere about that if I remember.

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [May 3, 2021, 8:19pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/6 "2021-05-03T20:19:55Z")

</div>

Yep, it is the issue [#488](https://github.com/fonsp/Pluto.jl/issues/488#issuecomment-825989604).

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [September 12, 2021, 11:24am UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/7 "2021-09-12T11:24:13Z")

</div>

Is there a way to make this work with `\begin{table}`? The following does not work for me. Thanks!

```julia
md"
$$\begin{table}[]
\begin{tabular}{lll}
\hline
c1 & c2 & c3 \\ \hline
\end{tabular}
\end{table}$$
"

```

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [September 12, 2021, 11:55am UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/8 "2021-09-12T11:55:17Z")

</div>

Hi,

Your code does not run in a LaTeX editor either.

This will work in Pluto

```julia
md"""
$\begin{array}{lcc}
\hline & \text { Treatment A } & \text { Treatment B } \\
\hline \text { John Smith } & 1 & 2 \\
\text { Jane Doe } & - & 3 \\
\text { Mary Johnson } & 4 & 5 \\
\hline
\end{array}$
"""

```

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [September 12, 2021, 1:27pm UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/9 "2021-09-12T13:27:57Z")

</div>

Thanks for your reply. That is strange. It works in Overleaf, as the attached image shows (perhaps it is calling third party packages). I will use array instead of table as you have suggested. Thank you!

 ![Overleaf](https://global.discourse-cdn.com/julialang/original/3X/7/0/70425224778915d5a9dfdaa136e42db698e33cc0.png)

---

<div class="post-metadata">

**Author:** ![ptoche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ptoche/32/23554_2.png) [@ptoche](https://discourse.julialang.org/u/ptoche)\
**Post date:** [November 29, 2021, 9:09am UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/10 "2021-11-29T09:09:16Z")

</div>

`table` is a floating environment, could that be the reason?

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [November 29, 2021, 9:28am UTC](https://discourse.julialang.org/t/pluto-how-to-insert-a-table-from-latex-code-into-markdown/60481/11 "2021-11-29T09:28:52Z")

</div>

If I remember correctly, Pluto supports array but not table. In the end, the produce similar results.
