带有unicode字符的jupyter笔记本PDF转换问题

时间:2018-02-23 15:04:57

标签: unicode latex jupyter-notebook xelatex nbconvert

我正在制作一个带有一些unicode字符(简称中文,在我的例子中)的数学课程笔记。当我试图将其转换为PDF文件时,它会弹出500错误。错误消息显示为:

...
*************************************************
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec-xetex.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\tuenc.def"))
("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\fontspec\fontspec.cfg")
! Undefined control sequence.
<argument> \LaTeX3 error: 
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }

? 
! Emergency stop.
<argument> \LaTeX3 error: 
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }

No pages of output.
Transcript written on notebook.log.

我认为fontspec部分出错了,但我不知道如何解决它。 为了您的信息,这是我在收到500错误之前所做的事情。

1.我已经安装了pandoc,之前我已经有了Miktex;

2.我已经更改了文件

...\nbconvert\templates\latex\article.tplx

将文章类重写为ctexart;

3.我已经更改了文件

...\nbconvert\templates\latex\exporters\pdf.py

将latex命令重写为

latex_command = List([u"xelatex", u"{filename}"], config=True, 
help="Shell command used to compile latex."
)

4.我还试过这个:&#34; https://github.com/ipython/ipython/issues/7150&#34;,它倾向于首先将ipynb文件转换为latex文件,然后转换为PDF。这对我也没有用。主要原因是jupyter nbconvert命令无法找到配置文件。

为了您的信息,我的操作系统是Win7 Ultimate x64,Chrome for Anaconda3 jupyter笔记本。

提前感谢任何花时间阅读我的帖子的人。任何帮助将不胜感激。

0 个答案:

没有答案
相关问题