It is possible to build a single PDF that contains all of your book’s content. This page describes a few ways to do so.
PDF building is experimental, and may change or have bugs.
There are two approaches to building PDF files:
It is also possible to build a single PDF from your book’s HTML. This first converts all of your book’s content into a single HTML file, and then renders it as a PDF by emulating a browser from the command-line.
Your system will need to use
pyppeteer to parse the generated html for
conversion to PDF.
If you wish to build a PDF from your book’s HTML, you will need the
You can install it like so:
pip install pyppeteer
You may also need to install this bundle of packages below (on *nix systems):
gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
To build a single PDF from your book’s HTML, use the following command:
jupyter-book build mybookname/ --builder pdfhtml
jb build mybookname/ --builder pdfhtml
You can also use Latex to build a PDF of your book. This can behave differently depending on your operating system and setup. This section tries to recommend a few best-practices.
Linux platforms it is recommended to install the following packages:
sudo apt-get install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra latexmk
alternatively you can install texlive
Windows please install texlive.
To build a single PDF using LaTeX, use the following command:
jupyter-book build mybookname/ --builder pdflatex
jb build mybookname/ --builder pdflatex
If you would just like to generate the latex file you may use:
jb build mybookname/ --builder latex