1

Is it possible to write LaTeX in jupyter? It seems that IPython.display.Latex supports only a subset of LaTeX equations. In particular I would like to use \tabular and others LaTeX commands (HTML is not an option).

Ruggero Turra
  • 16,929
  • 16
  • 85
  • 141
  • Related: http://stackoverflow.com/questions/28435997/ipython-jupyter-mathjax-preamble and http://stackoverflow.com/a/16660611/4573247. Comment to the 2nd linked answer, _"in Jupyter, it doesn't work in a markdown cell but it does work in a code cell."_ – dfrib Feb 10 '16 at 17:22
  • `%%latex` only works for equations. – Ruggero Turra Feb 10 '16 at 17:45

2 Answers2

2

You should have a look at the latex_envs extension in https://github.com/ipython-contrib/IPython-notebook-extensions (install from this repo, it is the most recent version -- follow the instructions in the README). Some documentation here https://rawgit.com/jfbercher/latex_envs/master/doc/latex_env_doc.html

jfb
  • 679
  • 6
  • 9
0

I recently tried this in Jupyter Lab. Mark a cell as "raw". Then:

   %%latex

  \bf{This is a test} \\
 It allows latex $\alpha=\beta$ and test:

 \begin{equation}
 \alpha = \beta
 \end{equation}
 % this is a latex comment

Then File -> Export Notebook as -> PDF

wander95
  • 1,298
  • 1
  • 15
  • 22