简体   繁体   English

如何在现有的Latex文档中集成Sphinx生成的Latex代码?

[英]How to integrate Sphinx-generated Latex code in existing Latex documents?

I've used Sphinx to document a Python library. 我已经用Sphinx记录了Python库。 So far this works great, I get nice HTML and LaTeX output. 到目前为止,这很好用,我得到了不错的HTML和LaTeX输出。 Concerning Latex, Sphinx generates a complete standalone document with lots of special packages and configurations. 关于Latex,Sphinx生成具有许多特殊软件包和配置的完整的独立文档。

But, I would like to integrate the generated Latex files within an already existing Latex project (more precise: in the appendix of a book). 但是,我想将生成的Latex文件集成到一个已经存在的Latex项目中(更精确的说:在书的附录中)。 In particular I want the Sphinx-generated documentation pages to have the header, footer and section heading styles of the parent document. 特别是我希望Sphinx生成的文档页面具有文档的页眉,页脚和节标题样式。 I guess I could somehow transfer the relevant parts by manually removing unneeded stuff and adjusting various options in the tex files generated by Sphinx. 我想我可以通过手动删除不需要的东西并调整Sphinx生成的tex文件中的各种选项来以某种方式转移相关部分。 However, probably this is going to be a very tedious fiddling taking too much of my time (thinking of conflicting packages and options I have to detect and fix). 但是,这可能会花费很多时间(非常麻烦的事情)(考虑冲突的软件包以及我必须检测和修复的选项)。

Does Sphinx' Latex-Builder support such a use case? Sphinx的Latex-Builder是否支持这种用例? If not, is there a more general approach how to merge independent Latex-documents? 如果不是,是否有更通用的方法来合并独立的Latex文档?

Thanks for any hints! 感谢您的提示!

It seems there is no generally valid answer to this question. 这个问题似乎没有普遍有效的答案。 I've asked this question on the sphinx mailing list and received an answer which basically says one has to manually extract and partly convert the relevant parts of the latex code generated by sphinx - a less expensive solution does not yet exist. 我已经在狮身人面像邮件列表中问了这个问题,并收到了一个答案 ,该答案基本上说一个人必须手动提取并部分转换由狮身人面像生成的乳胶代码的相关部分-尚不存在较便宜的解决方案。

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

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