简体   繁体   中英

Jupyter Book - Changing LateX preamble for PDFLatex based compilation

  • 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.

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:
    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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM