【问题标题】:Sphinx latex output filenameSphinx 乳胶输出文件名
【发布时间】:2021-02-26 22:35:23
【问题描述】:

在运行sphinx-build -b latex ... 时,Sphinx 会将*.tex 文件写入某个输出目录。 *.tex 文件的名称似乎以某种方式源自 conf.py 中设置的 project 标题。

我想将 Sphinx Latex 生成集成到我的构建系统中。对于依赖管理,我需要知道生成的*.tex 文件的确切名称。

有什么方法可以确定生成文件的名称,而无需将该名称硬编码到构建系统中?或者有没有办法手动设置这个名字(不改变project变量)?

【问题讨论】:

  • 您可以使用lsfindglob(或您的构建系统的操作系统等效项)来查找该文件
  • 但这只是在构建已经运行之后。我需要在配置阶段(CMake)之前知道它。另外,输出目录中可能有多个*.tex文件。
  • 可以使用latex_documents配置变量设置*.tex文件的名称:sphinx-doc.org/en/master/usage/…

标签: python latex python-sphinx


【解决方案1】:

根据 mzjn 的建议和Sphinx docs 中的说明,可以通过conf.py 中的latex_documents 选项设置*.tex*.pdf 文件的名称。

规范的用例可能是在conf.py的末尾添加以下内容。

#...
latex_documents = [('index', 'doc.tex', project, author, 'manual')]

这最终会产生一个文件doc.pdf

【讨论】:

  • rst2pdf 类似:pdf_documents = [("index", "outfilename", "title", author)]
猜你喜欢
  • 2011-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多