Jupyter笔记本:如何为LaTeX \ usepackage {} [英] Jupyter notebook: How to \usepackage{} for LaTeX
本文介绍了Jupyter笔记本:如何为LaTeX \ usepackage {}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何在Jupyter笔记本电脑中\usepackage{}
使用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 {}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文