0
  • I am using TexLive 2022 on Mac OSX.
  • I am using Jupyter Book to write a textbook with Python snippets, with a lot of mathematics in it.
  • I have been able to create Python notebooks with extension .ipynb for the various chapters therein.
  • I have changed the table of contents in the _config.yml file

With this context, I wish to ask how to change the base fonts for math and text type settings. For example I would wish to use the pxfonts package. Essentially, I wish to know how to control the preamble of latex.

See this link for more information on Jupyter Book and PDF.

Indian
  • 977
  • 3
  • 12
  • 24

1 Answers1

0

At the bottom of your linked page, I found the following:

Configuration via Sphinx LaTeX settings can be passed through using the config section of sphinx in the _config.yml file for your project.

Here is more on _config.yml: https://jupyterbook.org/en/stable/customize/config.html

Here is more on Sphinx: https://www.sphinx-doc.org/en/master/latex.html?highlight=latex%20package

Have you added the following to your _config.yml?

sphinx:
  config:
    latex_elements:
      preamble: '\usepackage{pxfonts}'

If that does not work, you could build to latex with jb build --builder latex /path/to/notebooks, then manually edit the .tex file.

Richard Herron
  • 9,760
  • 12
  • 69
  • 116