参考 https://nbconvert.readthedocs.io/en/latest/customizing.html
使用jupyter导出pdf时,中文会不显示,这是因为nbconvert的默认模板不支持中文字符,需要对该模板进行修改。
首先,使用
jupyter --path
依次查看其中data
的目录列表,看有没有../share/jupyter/nbconvert
路径,若有,则进入到
../share/jupyter/nbconvert/templates/latex/
找到index.tex.j2
, 修改documentclass
为ctex
\documentclass[11pt]{ctex}
然后重新导出即可。