Ruggero Turra
Ruggero Turra

Reputation: 17670

How to write LaTeX in jupyter (not just equations)

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

Upvotes: 1

Views: 10230

Answers (3)

mh57
mh57

Reputation: 13

Use Anaconda. In Jupyter Notebook as part of Anaconda you can simply use $latex_code$ for inline or $$latex_code$$ for display.

Upvotes: 0

wander95
wander95

Reputation: 1366

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

Upvotes: 0

jfb
jfb

Reputation: 679

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

Upvotes: 2

Related Questions