本文介绍了Jupyter 笔记本:如何为 LaTeX 使用 usepackage{}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何usepackage{}
在 Jupyter notebook 中使用 LaTeX.
I would like to know how I can usepackage{}
for LaTeX in Jupyter notebook.
推荐答案
不确定这是唯一甚至是最好的方法,但它似乎有效.在与您的 ipynb 笔记本文件(mynotebook.ipynb")相同的目录中编写一个模板文件(mytemplate.tplx").mytemplate.tplx 看起来像:
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 *))
通过执行以下命令构建您的 pdf LaTex 文件:
Build your pdf LaTex file by executing the following:
jupyter nbconvert mynotebook.ipynb --to latex --template mytemplate.tplx
pdflatex mynotebook.tex
这篇关于Jupyter 笔记本:如何为 LaTeX 使用 usepackage{}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!