I would like to know how I can \usepackage{}
for LaTeX in Jupyter notebook.
One of the most popular is Jupyter Notebook that uses MathJax to render the Latex syntax inside the markdown/HTML. To use LaTeX in the Jupyter notebook, put the Latex math content inside the '$ … $' double '$$ … $$' symbols.
Jupyter Book uses MathJax for typesetting math in your HTML book build. This allows you to have LaTeX-style mathematics in your online content.
Not sure this is the only or even best way of doing it, but it seems to work. Write a template file ("mytemplate.tplx") in the same directory as your ipynb notebook file ("mynotebook.ipynb"). mytemplate.tplx looks like:
((*- extends 'article.tplx' -*)) ((* block packages *)) ((( super() ))) \usepackage{amsmath} \usepackage{newtxtext,newtxmath} ((* endblock packages *))
Build your pdf LaTex file by executing the following:
jupyter nbconvert mynotebook.ipynb --to latex --template mytemplate.tplx pdflatex mynotebook.tex
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With