简体   繁体   English

狮身人面像 latex output 文件名

[英]Sphinx latex output filename

When running sphinx-build -b latex... Sphinx writes a *.tex file into some output directory.当运行sphinx-build -b latex...时,Sphinx 将*.tex文件写入某个 output 目录。 The name of that *.tex file seems to somehow be derived from the project title set in conf.py .*.tex文件的名称似乎以某种方式源自conf.py中设置的project标题。

I'd like to integrate the Sphinx Latex generation into my build system.我想将 Sphinx Latex 一代集成到我的构建系统中。 For the dependency management I need to know the exact name of the generated *.tex file.对于依赖管理,我需要知道生成的*.tex文件的确切名称。

Is there any way to determine the name of the generated file without hard-coding that name into the build system?有什么方法可以确定生成文件的名称,而无需将该名称硬编码到构建系统中? Or is there a way to set this name manually (without changing the project variable)?或者有没有办法手动设置这个名称(不改变project变量)?

As suggested by mzjn and explained in the Sphinx docs , one can set the name of the *.tex and *.pdf files via the latex_documents option in conf.py .正如 mzjn 所建议并在Sphinx 文档中解释的那样,可以通过 conf.py 中的latex_documents选项设置*.tex*.pdf文件的conf.py

The canonical use case is probably to add the following at the end of conf.py .规范的用例可能是在conf.py的末尾添加以下内容。

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

This eventually produces a file doc.pdf .这最终会生成一个文件doc.pdf

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

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