atom-community / markdown-preview-plus

Markdown Preview + Community Features
https://atom.io/packages/markdown-preview-plus
Other
370 stars 85 forks source link

Displaying LaTeX Tables in the Preview #46

Closed djbucci closed 9 years ago

djbucci commented 9 years ago

Does the current version of markdown-preview-plus support rendering LaTeX tables in the preview window using pandoc? For example, if I drop in...

\begin{table}
\begin{tabular}{lcr}
Number1 & Number2 & Number3 \\
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}
\end{table} 

and set the markdown flavor to markdown+raw_tex, just the above text renders (with the LaTeX commands). If I run pandoc and output to PDF though (for example), the table shows up.

Thanks for the help, and love the package!

Galadirith commented 9 years ago

@djbucci Thanks for checking out MPP :D

Unfortunately MPP doesn't support rendering LaTeX tables. MPP uses MathJax to process the LaTeX blocks in markdown documents. The environments it supports are limited to those that can be used in maths environments in a normal LaTeX document. You can find a list of all the supported environments here.

The best solution to get close to a tabular environment is the array environment that is supported.

I'm sorry its likely not the answer you were hoping for, but please do post back if you had any other questions. Thanks @djbucci.

djbucci commented 9 years ago

No problem! It would actually be very helpful to have this link on the main page for MPP for added context.

Thanks again!

Sent from my iPhone

On Jul 17, 2015, at 9:51 AM, Edward Fauchon-Jones notifications@github.com wrote:

@djbucci Thanks for checking out MPP :D

Unfortunately MPP doesn't support rendering LaTeX tables. MPP uses MathJax to process the LaTeX blocks in markdown documents. The environments it supports are limited to those that can be used in maths environments in a normal LaTeX document. You can find a list of all the supported environments here.

The best solution to get close to a tabular environment is the array environment that is supported.

I'm sorry its likely not the answer you were hoping for, but please do post back if you had any other questions. Thanks @djbucci.

— Reply to this email directly or view it on GitHub.

Galadirith commented 9 years ago

Thanks @djbucci. That is a great suggestion and an oversight on my part, I'll make sure its there in the next release :D

leipert commented 9 years ago

Sorry that I am late to the party. @djbucci, actually the pandoc option +raw_tex is not supported in HTML output, as you can find find the pandoc documentation:

Inline LaTeX is ignored in output formats other than Markdown, LaTeX, and ConTeXt

You can see this best in this minimal example.

### Test raw_tex

The cake was \emph{huge} for a cup cake

If you have +raw_tex enabled, raw latex will be stripped:

screen shot 2015-07-24 at 06 18 19

If you have -raw_tex disabled:

screen shot 2015-07-24 at 06 18 36

@Galadirith, maybe we also should add this to the pandoc part of the documentation.

Galadirith commented 9 years ago

@leipert thanks so much for the input. I definitely think adding that to the documentation would be beneficial. Perhaps just adding a couple of subsections to the top of Usage would be appropriate; Supported Pandoc features and Supported LaTeX commands.