# In-line LaTex in Notebooks

**URL:** <https://discourse.jupyter.org/t/in-line-latex-in-notebooks/15709>\
**Category:** Notebook\
**Created:** [September 9, 2022, 2:23pm UTC](https://discourse.jupyter.org/t/in-line-latex-in-notebooks/15709 "2022-09-09T14:23:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aref](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@aref](https://discourse.jupyter.org/u/aref)\
**Post date:** [September 9, 2022, 2:23pm UTC](https://discourse.jupyter.org/t/in-line-latex-in-notebooks/15709/1 "2022-09-09T14:23:19Z")

</div>

I am new to Jupyter and only somewhat experienced in Python, however have many years of experience with C, MATLAB, and others. At this time I know how to launch Jupyter notebook and carry out calculations.

That said, I know Jupyter notebook environment can be used to carry out scientific calculations and write science articles all in one place, but need to know how?

Please tell me the simplest approach for including LaTex in my notebook?

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [September 9, 2022, 3:42pm UTC](https://discourse.jupyter.org/t/in-line-latex-in-notebooks/15709/2 "2022-09-09T15:42:32Z")

</div>

> [@aref](#):
>
> Please tell me the simplest approach for including LaTex in my notebook?

Just some starting pointers:  
See the bottom of my post [here](https://discourse.jupyter.org/t/how-to-use-jupyter-to-print-latex-into-code-for-math/10940/2) and then Tony Hirst’s (@psychemedia) post right after that one for links to great examples. [This trick might help you down the road](https://stackoverflow.com/a/71741100/8508004) when trying to combine with text and control how it displays in Jupyter. Also see [here](https://stackoverflow.com/a/40866155/8508004) and [here for reminder about `%%latex` cell magic](https://stackoverflow.com/a/13222501/8508004). (In regards to the `%%latex` use, actually see the link to use in an example notebook in [this post](https://stackoverflow.com/a/16660611/850800) because it seems it has to be **full-blown latex code** and not just simple equations that work easily elsewhere with just dollar signs bracketing them, i.e., MathJax.)

> [@aref](#):
>
> can be used to carry out scientific calculations and write science articles all in one place, but need to know how?

While you can combine Python’s math abilities and Jupyter’s markdown/Latex/MathJax abilities, see [here](https://discourse.jupyter.org/t/how-to-add-markdown-inside-a-function-to-pretty-print-equation/2719/2), for convenience with calculations, SymPy is a package that you’ll probably want to check out. See:

- [SymPy Examples](https://github.com/josephcslater/Introduction_to_Python/blob/0d30771ed135432fe27ec830c741eb7c30a1ec3c/SymPy_Examples.ipynb)
- [Try the latest SymPy release directly in your browser, without installing anything](https://twitter.com/jtpio/status/1523660682708668416)
- [Calculus Examples Using SymPy](https://github.com/josephcslater/Introduction_to_Python/blob/0d30771ed135432fe27ec830c741eb7c30a1ec3c/Calc_Review.ipynb)
- [Display command output as math : IPython.display.Math? - #2 by fomightez](https://discourse.jupyter.org/t/display-command-output-as-math-ipython-display-math/3125/2) (and entire thread actually)
- [Solving for a limit with SymPy](https://stackoverflow.com/a/60242641/8508004)
- [SymPy can even plot equations](https://twitter.com/jeremyphoward/status/1524602161434607617)

As for writing scientific articles in it, you may want to look into Curvenote. See [here](https://twitter.com/curvenote/status/1445461176150740993). Also see the [JupyterLab extension for live editing of LaTeX documents](https://github.com/jupyterlab/jupyterlab-latex).

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [September 14, 2022, 3:27pm UTC](https://discourse.jupyter.org/t/in-line-latex-in-notebooks/15709/3 "2022-09-14T15:27:47Z")

</div>

I did some minimal `sympy` demos at [Maths Overview — Subject Matter Authoring Using Jupyter Notebooks](https://opencomputinglab.github.io/SubjectMatterNotebooks/maths/overview.html) and there’s also so sympy examples in context of a electronics calculations package at : [Electronics Worked Example — Subject Matter Authoring Using Jupyter Notebooks](https://opencomputinglab.github.io/SubjectMatterNotebooks/electronics/worked-example.html)
