将Jupyter Notebook转换为PDF-在PATH上找不到pdflatex [英] Convert Jupyter notebook to PDF - pdflatex not found on PATH

查看:219
本文介绍了将Jupyter Notebook转换为PDF-在PATH上找不到pdflatex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试通过以下步骤从Web界面以PDF格式下载Jupyter笔记本:

I'm trying to download my Jupyter notebook as a PDF from the web interface by going to:

文件->通过LaTeX下载为-> PDF

File -> Download as -> PDF via LaTeX

但是,出现此错误:

nbconvert failed: pdflatex not found on PATH

我同时安装了pandoc和MacTex.此外,在终端中设置了pdflatex.

I have both pandoc and MacTex installed. Additionally, in the terminal the pdflatex is set.

$ which pdflatex
/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/pdflatex

我正在使用Jupyter 4.2.0和Python 2.7.11在Mac OS X El Capitan上运行

I'm running on Mac OS X El Capitan using Jupyter 4.2.0 with Python 2.7.11

推荐答案

使用浏览器(ctrl + p)将其打印为pdf.这很简单,打印出所见即所得"的方法非常适合与不编写代码或不使用jupyter环境的人员共享报告/分析.尚未通过任何方式准备发布,但已完成工作.只需确保您的图和图不在交互模式下,否则它们将不会显示(将它们设置为%matplotlib内联).

Print it to pdf using your browser (ctrl+p). It is simple and the "you print what you see" approach is great to share a reports/analysis with people that do not code or use the jupyter enviroment. Not publication ready by any means but gets the job done. Just make sure your plots and figures are not on interactive mode otherwise they will not be displayed (set them to %matplotlib inline).

我始终无法通过乳胶将jupyter nb导出为pdf.快速搜索,您会看到很多人这样做.我可以解决一些问题,但是代码格式乏善可陈,并且绘图无法按照我想要的方式显示.我最终接受了jupyter笔记本无法轻松生成已发布就绪"的pdf文件的信息.当我需要时,我在jupyter上生成图/图/代码,并在乳胶文件上调用它们.

I always had trouble with exporting my jupyter nb to pdf through latex. Quick search and you see that A LOT of people do. I could get some stuff worked out but the formatting was lackluster with code and plots not displayed the way I wanted. I eventually accepted that the jupyter notebook could not produce "publish-ready" pdfs easily. When I want that, I generate plots/figures/code on jupyter and call them on a latex file.

您可能想隐藏您的pdf中的一些代码,设置解决方案,并添加一些扩展名以改善您的Jupyter文档. 如果您真的想从jupyter内部进行发布,则此教程包含一些内容很棒的提示.

You may want to hide some of your code from the pdf, set the resolution of your plots and add some extensions to improve your jupyter documents. If you really want to make your publications from inside jupyter, this tutorial has some great tips.

这篇关于将Jupyter Notebook转换为PDF-在PATH上找不到pdflatex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆