Jupyter notebook: How to \usepackage{} for LaTeX

守給你的承諾、 提交于 2019-12-09 04:40:55

问题


I would like to know how I can \usepackage{} for LaTeX in Jupyter notebook.


回答1:


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


来源:https://stackoverflow.com/questions/40448200/jupyter-notebook-how-to-usepackage-for-latex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!