将Jupyter Notebook中的python脚本转化为PDF文件

将python脚本转换PDF文件

  1. 安装nbconvert(pip install nbconvert or conda install nbconvert)
    https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.)

  2. 继续安装pandoc,下载速度极慢,尝试手机QQ浏览器下载后传百度网盘。
    https://pandoc.org/

  3. 继续安装Tex的环境。windows下可用安装MikTex(需要64位系统)(https://miktex.org/howto/install-miktex

  4. 修改article.aplx文件
    https://blog.csdn.net/wxw_csdn/article/details/88836942

解决转PDF文件时日文显示的问题

  1. 在C:\Users\1410131\AppData\Local\Continuum\anaconda3\Lib\site-packages\nbconvert\templates\latex\aricle文件的
    \documentclass下添加:\usepackage{luatexja}

  2. 导出Notebook页面时选择Download as LaTex。

  3. 用miktex打开导出的Tex文件,并使用LuaLaTex排版。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容