简体   繁体   English

Jupyter Book - 为基于 PDFLatex 的编译更改 LateX 前导码

[英]Jupyter Book - Changing LateX preamble for PDFLatex based compilation

  • I am using TexLive 2022 on Mac OSX.我在 Mac OSX 上使用 TexLive 2022。
  • I am using Jupyter Book to write a textbook with Python snippets, with a lot of mathematics in it.我正在使用 Jupyter Book 编写带有 Python 片段的教科书,其中包含很多数学知识。
  • I have been able to create Python notebooks with extension .ipynb for the various chapters therein.我已经能够为其中的各个章节创建扩展名为.ipynb的 Python 笔记本。
  • I have changed the table of contents in the _config.yml file我已更改_config.yml文件中的目录

With this context, I wish to ask how to change the base fonts for math and text type settings.在这种情况下,我想问一下如何更改基础 fonts 的数学和文本类型设置。 For example I would wish to use the pxfonts package.例如,我希望使用pxfonts package。 Essentially, I wish to know how to control the preamble of latex.本质上,我想知道如何控制 latex 的序言。

See this link for more information on Jupyter Book and PDF.有关 Jupyter Book 和 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.通过 Sphinx LaTeX 进行配置可以使用项目的 _config.yml 文件中 sphinx 的 config 部分进行设置。

Here is more on _config.yml: https://jupyterbook.org/en/stable/customize/config.html这里有更多关于 _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这是关于狮身人面像的更多信息: https://www.sphinx-doc.org/en/master/latex.html?highlight=latex%20package

Have you added the following to your _config.yml?您是否在 _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.如果这不起作用,您可以使用jb build --builder latex /path/to/notebooks构建到 latex ,然后手动编辑 .tex 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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