jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.72k stars 564 forks source link

Pdf's not produced. [ubuntu 16.04 / python 3.6] #561

Open bharathgs opened 7 years ago

bharathgs commented 7 years ago

With the nbconvert command, I am unable to create pdf from my ipynb notebooks, it converts the notebooks to HTML/markdown but not pdf.

I have texlive-latex-base and pandoc installed on my system

here is the latex details:

pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) kpathsea version 6.2.1 Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Compiled with libpng 1.6.17; using libpng 1.6.17 Compiled with zlib 1.2.8; using zlib 1.2.8 Compiled with poppler version 0.41.0

I get this error:

nbconvert failed: PDF creating failed, captured latex output: This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./notebook.tex LaTeX2e <2016/02/01> Babel <3.9q> and hyphenation patterns for 3 language(s) loaded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def) kpathsea: Running mktextfm ecrm1095 /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation for ecrm1095. /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update ? mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1095 This is METAFONT, Version 2.7182818 (TeX Live 2015/Debian) (preloaded base=mf) kpathsea: Running mktexmf ecrm1095 ! I can't find file ecrm1095'. <*> ...ljfour; mag:=1; nonstopmode; input ecrm1095 Please type another input file name ! Emergency stop. <*> ...ljfour; mag:=1; nonstopmode; input ecrm1095 Transcript written on mfput.log. grep: ecrm1095.log: No such file or directory mktextfm:mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1095' failed to make ecrm1095.tfm. kpathsea: Appending font creation commands to missfont.log. ! Font T1/cmr/m/n/10.95=ecrm1095 at 10.95pt not loadable: Metric (TFM) file not found. relax l.105 \fontencoding\encodingdefault\selectfont
? ! Emergency stop. relax l.105 \fontencoding\encodingdefault\selectfont ! ==> Fatal error occurred, no output PDF file produced! Transcript written on notebook.log.

mpacer commented 7 years ago

If you convert to .tex and then use xelatex to convert that does it work? Because that looks like you have an issue with your TeX system not with nbconvert.

bharathgs commented 7 years ago

It says ecrm1095 is missing, which is a font(or something in the fonts package) so I tried reinstalling the latex-recommended-fonts package.and I get the same error.

mpacer commented 7 years ago

That suggests it's not a nbconvert error, what do you need to modify in the .tex file that is created in order to get the conversion to work?

JosefAssad commented 7 years ago

The ubuntu package search suggests that it's in the texlive-fonts-recommended package. so this ought to help:

sudo apt install texlive-fonts-recommended

It is indeed not an nbconvert issue, but I can imagine that TeX familiarity will in general be fairly low. It might be smart to supplement the installation documentation with distro/OS instructions. If you agree I can do Debian, it's really just a few lines.

firstdayofjune commented 4 years ago

On macOS the fonts can be installed through the TeX Live package manager:

sudo tlmgr install collection-fontsrecommended

which solved the issue for me.