jupyter notebook导出含有中文的pdf文件
jupyter notebook中如果含有中文,直接导出pdf的话可能出现错误,或者是乱码。所以下面介绍一种解决方法。
首先,把jupyter notebook下载为tex文件。
之后,解压缩该zip文件,使用一个文本编辑器(比如notepad)编辑tex文件。
加入以下三行:
\usepackage{fontspec, xunicode, xltxtra}
\setmainfont{Microsoft YaHei}
\usepackage{ctex}
保存。
然后在windows下打开Tex Live command-line,进入该文件夹下。
输入xelatex classification.tex
classification.tex是你的文件夹下的tex文件名。
编译完成,打开pdf发现,中文成功显示: