Jupyter Notebook PDF output in Chinese, jupyternotebook
What is Jupyter Notebook?
Jupyter Notebook is an upgrade of ipython Notebook. Jupyter canReal-Time Code, Formulas, and visual charts are organized together in Cell form to form a code-friendly notebook. Jupyter supports both Markdown and LaTeX syntaxes to effectively output PDF files in Rich Text mode.
Ipython nbconvert -- to latex Example. ipynb
Modify tex to support Chinese Characters
Insert after \ documentclass {article}
- Compile tex to generate a pdf file
xelatex Example.tex
Note: The pdf generated in this mode cannot be automatically wrapped!
Another method is recommended -- directly modify the tex template file.
Open article. tplx (\ Python27 \ Lib \ site-packages \ nbconvert \ templates \ latex \) in a text editor and change it to \ documentclass {ctexart }.
The generated pdf is as follows: Baidu Library
Thanks
The solution in this article comes from
Known issues
When xelatex is used for compiling, the inserted image is automatically set to the page width.
Solution: Modify tex and add the appropriate scaling ratio.
\includegraphics{figpath}
To:
\includegraphics[scale = .5]{figpath}
To learn more about Latex, we recommend that you read the LaTeX Notes from the package instructor.