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

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:

$$
\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

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.

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}$$.

1 Like

@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

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

1 Like

@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.

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

Yep, it is the issue #488.

1 Like

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

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

Hi,

Your code does not run in a LaTeX editor either.

This will work in Pluto

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}$
"""
2 Likes

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!

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

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

1 Like