I am using Jupyter for the first time. I am trying to download a notebook "as PDF via LaTeX". However, messages pop up indicating that the required files

tex\xelatex\xetex-def\xetex.def (part of the xetex-def package)


tex\xelatex\xetexurl\url.sty (part of the xetexurl package)

are missing. The problem is that neither package seems to be available at


Using the MiKTeX Package Manager (which I have synchronized), I have installed the graphics-def package, which apparently includes the xetex.def file. But the downloading process is still not working.

Any help would be greatly appreciated.

  • 2
    From your description it is not possible to decide if the problem is in miktex or in jupyter or in something local to your PC. I never heard of an url.sty in such a location and this sound like wrong code. Also I just installed a package and it worked fine . – Ulrike Fischer Jul 22 '17 at 11:00
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Martin Schröder Jul 22 '17 at 20:12
  • Trying this on a mac, downloading as "LaTeX" and then running through pdflatex worked fine. The download as "pdf via LaTeX" also gave me (different) error messages (this time about directories not existing). – Andrew Swann Nov 24 '17 at 15:30

I know it is not exactly what you want but have you tried to 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.

Use this to hide your code from the pdf or explore these extensions to improve your jupyter documents. If you really want to make your publications from inside jupyter, this tutorial attempts that and has some great tips.

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.


In Ubuntu 16.04 with Jupyter installed via pip, I had to do the following to install all fonts and generic packages for Latex:

sudo apt-get install texlive-xetex
sudo apt-get install texlive-fonts-recommended
sudo apt-get install cm-super
sudo apt-get install texlive-generic-recommended
wget https://github.com/jgm/pandoc/releases/download/2.1.2/pandoc-2.1.2-1-amd64.deb
sudo dpkg -i pandoc-2.1.2-1-amd64.deb

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.