11. Building a PDF#
One can use
jb build course --builder pdflatex
to create a PDF instead of HTML output.
With the default options, the PDF output is not perfect.
For example, margins and code-blocks/cells have a lot of space for improvement, and admonitions could use some coloring.
The template contains some changes to the default options, most if not all of which can be found under sphinx:config:latex_elements.
The documentation for this configuration can be found here.
11.1. Notes#
sphinx-proofat least for some of its directives uses the{note}directive. This means that changing the styling of{note}will also affect them, for example{algorithm}.quantecon-book-theme-related constraints lead to having an old version ofsphinx, which doesn’t have everysphinxsetupkey used in the template. For more details, see quantecon-book-theme-imposed version constraints.fontspecis used to set DejaVu Sans Mono (the font used in Julia documentation) as the font for code-blocks (viafancyvrb).fontspecdoesn’t work withpdflatex, butjupyter-bookby default usesxelatexanyway so this shouldn’t be a problem.Source Sans Pro is set as the default text font, matching the HTML theme. Size is set to 11pt, because I thought 10 was too small and 12 too big.
Titles, links and admonitions are colored using the (shades of the) first four colors here.
Chapter styling is adjusted with
titlesec.