Jupyter Notebook PDF output in Chinese, jupyternotebook

Source: Internet
Author: User
Tags jupyter jupyter notebook

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}

    • \usepackage{fontspec, xunicode, xltxtra}\setmainfont{Microsoft YaHei}
    • 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.

     

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.