【发布时间】:2021-03-26 17:26:13
【问题描述】:
我有不同的 ANCIENT 模板来将 Jupyter 笔记本转换为 PDF,但从 5.0 版开始jupyter-nbconvert(至少,这是 Debian 上的二进制文件的名称)默认使用 XeLaTeX,而且碰巧有些这些模板中的一些在与 XeLaTeX 一起使用时很好,其他模板仍然需要 pdfLaTeX。
我可以使用jupyter-nbconvert --to latex --template old_template MyNotebook,然后从CLI 运行pdflatex,这就是我到目前为止所做的,但我想知道是否有办法告诉Jupyter 我想使用pdflatex。
我知道 NBConvert 有一个配置选项,
PDFExporter.latex_command : List
Default: ['xelatex', '{filename}', '-quiet']
Shell command used to compile latex.
但我更喜欢命令行上的东西,这样我就可以定义别名以针对不同的用例使用不同的 TeX 引擎。
【问题讨论】:
-
nbconvert.readthedocs.io/en/latest/config_options.html 说“配置选项可以在文件中设置,
~/.jupyter/jupyter_nbconvert_config.py,或在启动 nbconvert 时的命令行,即jupyter nbconvert --Application.log_level=10。”跨度> -
看起来您还可以在 CLI 上指定配置文件 (nbconvert.readthedocs.io/en/latest/…) 也许您可以在 CLI 上指定的配置文件中定义
PDFExporter.latex_command,就像您指定模板一样? -
@PranavHosangadi 我对与 jupyter 相关的配置感到相当困惑,我需要一个详细的、逐步的、可验证的答案...您不介意提供这样的答案吗?
标签: python jupyter-notebook jupyter nbconvert