Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install missing dependencies (adjustbox.sty) to convert an Ipython notebook into pdf format?

I have an IPython notebook which I am trying to convert to PDF format. But when I go to file and do download as PDF, it gives me following error:

nbconvert failed: PDF creating failed

Any ideas? I think some dependencies seem to be missing. Could you advise how to install them in anaconda?

Edit:

Adding the log printed to console when I run download as pdf.

[I 16:00:48.396 NotebookApp] Loaded template article.tplx
[I 16:00:49.414 NotebookApp] Writing 51786 bytes to notebook.tex
[I 16:00:49.415 NotebookApp] Building PDF
[I 16:00:49.435 NotebookApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[C 16:00:49.853 NotebookApp] pdflatex failed: [u'pdflatex', u'notebook.tex']
    This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    (./notebook.tex
    LaTeX2e <2014/05/01>
    Babel <3.9k> and hyphenation patterns for 21 languages loaded.
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/size10.clo))
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphicx.sty
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/keyval.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphics.sty
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/trig.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/latexconfig/graphics.cfg)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/pdftex-def/pdftex.def
    (/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))

    ! LaTeX Error: File `adjustbox.sty' not found.

    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: sty)

    Enter file name: 
    ! Emergency stop.
    <read *> 

    l.19     \usepackage
                        {color} % Allow colors to be defined^^M
    !  ==> Fatal error occurred, no output PDF file produced!
    Transcript written on notebook.log.

[I 16:00:49.860 NotebookApp] Running bibtex 1 time: [u'bibtex', u'notebook']
[W 16:00:49.887 NotebookApp] bibtex had problems, most likely because there were no citations
[I 16:00:49.893 NotebookApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[C 16:00:49.923 NotebookApp] pdflatex failed: [u'pdflatex', u'notebook.tex']
    This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
     restricted \write18 enabled.
    entering extended mode
    (./notebook.tex
    LaTeX2e <2014/05/01>
    Babel <3.9k> and hyphenation patterns for 21 languages loaded.
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/size10.clo))
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphicx.sty
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/keyval.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphics.sty
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/trig.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/latexconfig/graphics.cfg)
    (/usr/local/texlive/2014basic/texmf-dist/tex/latex/pdftex-def/pdftex.def
    (/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
    (/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))

    ! LaTeX Error: File `adjustbox.sty' not found.

    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: sty)

    Enter file name: 
    ! Emergency stop.
    <read *> 

    l.19     \usepackage
                        {color} % Allow colors to be defined^^M
    !  ==> Fatal error occurred, no output PDF file produced!
    Transcript written on notebook.log.

[W 16:00:49.925 NotebookApp] 500 GET /nbconvert/pdf/A2_SpectralClustering.ipynb?download=true (::1): nbconvert failed: PDF creating failed
[E 16:00:49.950 NotebookApp] {
      "Accept-Language": "en-us", 
      "Accept-Encoding": "gzip, deflate", 
      "Connection": "keep-alive", 
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/6.2.3 Safari/537.85.12", 
      "Dnt": "1", 
      "Host": "localhost:8888", 
      "Referer": "http://localhost:8888/notebooks/A2_SpectralClustering.ipynb"
    }
[E 16:00:49.950 NotebookApp] 500 GET /nbconvert/pdf/A2_SpectralClustering.ipynb?download=true (::1) 2096.70ms referer=http://localhost:8888/notebooks/A2_SpectralClustering.ipynb
like image 506
Baktaawar Avatar asked Mar 26 '15 00:03

Baktaawar


3 Answers

for mac,

$ sudo tlmgr install adjustbox

additionally you would also need to install:

$ sudo tlmgr install texlive-fonts-recommended 
like image 136
Parul Avatar answered Nov 13 '22 00:11

Parul


On Ubuntu 14.04 it worked to install this package:

sudo apt-get install texlive-latex-extra
like image 32
nealmcb Avatar answered Nov 13 '22 01:11

nealmcb


On Fedora 22, I ran into this same issue. I had to install the "texlive-adjustbox" package and then everything worked as expected.

sudo dnf install texlive-adjustbox

You shouldn't need to use anaconda to resolve this issue, but rather it's a lower level dependency that is missing.

like image 2
Brandon C. Avatar answered Nov 12 '22 23:11

Brandon C.