0

I am trying to convert a Jupyter notebook to PDF in OSX. I got various errors that comes down to upgrading tlmgr

(base) mona@goku:~/Downloads/HW2_solutions$ ls /Library/TeX/texbin/tlmgr
lrwxr-xr-x  1 mona  wheel  41 Mar 20  2019 /Library/TeX/texbin/tlmgr -> ../../texmf-dist/scripts/texlive/tlmgr.pl
(base) mona@goku:~/Downloads/HW2_solutions$ tlmgr update --self --all
/Library/TeX/texbin/tlmgr: open tlpdb(https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb) failed: No such file or directory at /usr/local/texlive/2018basic/tlpkg/TeXLive/TLPDB.pm line 362.

For example:

$ sudo tlmgr install adjustbox
Password:
/Library/TeX/texbin/tlmgr: open tlpdb(https://mirrors.rit.edu/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb) failed: No such file or directory at /usr/local/texlive/2018basic/tlpkg/TeXLive/TLPDB.pm line 362.

(base) mona@goku:~/Downloads/HW2_solutions$ sudo tlmgr install collectbox
tlmgr: Remote repository is newer than local (2018 < 2020)
Cross release updates are only supported with
  update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.

Here's the complete log that I got for PDF conversion:

(base) mona@goku:~/Downloads/HW2_solutions$ jupyter nbconvert HW2_solutions.ipynb --to pdf
[NbConvertApp] Converting notebook HW2_solutions.ipynb to pdf
[NbConvertApp] Support files will be in HW2_solutions_files/
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Making directory HW2_solutions_files
[NbConvertApp] Writing 84900 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', 'notebook.tex']
[NbConvertApp] CRITICAL | xelatex failed: ['xelatex', 'notebook.tex']
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2018-04-01> patch level 2
Babel <3.18> and hyphenation patterns for 22 language(s) loaded.
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics-def/xetex.def)))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/caption/caption3.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.42     \usepackage
                    {xcolor} % Allow colors to be defined^^M
No pages of output.
Transcript written on notebook.log.

Traceback (most recent call last):
  File "/Users/mona/anaconda3/bin/jupyter-nbconvert", line 11, in <module>
    sys.exit(main())
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 325, in start
    self.convert_notebooks()
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 493, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 464, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/Users/mona/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/pdf.py", line 183, in from_notebook_node
    raise LatexFailed('\n'.join(self._captured_output))
nbconvert.exporters.pdf.LatexFailed: PDF creating failed, captured latex output:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2018-04-01> patch level 2
Babel <3.18> and hyphenation patterns for 22 language(s) loaded.
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/graphics-def/xetex.def)))
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2018basic/texmf-dist/tex/latex/caption/caption3.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.42     \usepackage
                    {xcolor} % Allow colors to be defined^^M
No pages of output.
Transcript written on notebook.log.

My tlmgr version is:

$ tlmgr --version
tlmgr revision 47303 (2018-04-05 19:52:22 +0200)
tlmgr using installation: /usr/local/texlive/2018basic
TeX Live (http://tug.org/texlive) version 2018

Following the answer here should help except I don't know what is the correct way of upgrading tlmgr fro 2018 to 2020 version:

https://github.com/ipython/ipython/issues/8814#issuecomment-146967331

sudo tlmgr install adjustbox
sudo tlmgr install collectbox
sudo tlmgr install ucs
1
  • The message is very clear, you're using a 2018 basic tex which can no longer be updated. You'll need a 2020 version
    – daleif
    Commented Aug 24, 2020 at 18:56

1 Answer 1

1

Downloaded the mac tex 2020 version and all errors were gone

http://tug.org/mactex/mactex-download.html

$ jupyter nbconvert HW2_solutions.ipynb --to pdf

created the HW2_solutions.pdf

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .