如何将Sphinx生成的Latex代码集成到现有的Latex文档中? [英] How to integrate Sphinx-generated Latex code in existing Latex documents?

查看:163
本文介绍了如何将Sphinx生成的Latex代码集成到现有的Latex文档中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Sphinx记录了Python库.到目前为止,这很好用,我得到了不错的HTML和LaTeX输出.关于Latex,Sphinx生成了一个完整的独立文档,其中包含许多特殊的程序包和配置.

I've used Sphinx to document a Python library. So far this works great, I get nice HTML and LaTeX output. Concerning Latex, Sphinx generates a complete standalone document with lots of special packages and configurations.

但是,我想将生成的Latex文件集成到一个已经存在的Latex项目中(更精确的说:在书的附录中).特别是我希望Sphinx生成的文档页面具有 parent 文档的页眉,页脚和节标题样式.我想我可以通过手动删除不需要的东西并调整Sphinx生成的 tex 文件中的各种选项来以某种方式转移相关部分.但是,这可能会花费很多时间(非常麻烦的事情)(考虑有冲突的软件包以及我必须检测和修复的选项).

But, I would like to integrate the generated Latex files within an already existing Latex project (more precise: in the appendix of a book). In particular I want the Sphinx-generated documentation pages to have the header, footer and section heading styles of the parent document. 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. 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).

Sphinx的Latex-Builder是否支持这种用例?如果不是,是否有更通用的方法来合并独立的Latex文档?

Does Sphinx' Latex-Builder support such a use case? If not, is there a more general approach how to merge independent Latex-documents?

感谢任何提示!

推荐答案

对于这个问题,似乎没有普遍有效的答案.我在 sphinx 邮件列表中问了这个问题,并收到了 answer 基本上说,必须手动提取并部分转换sphinx生成的乳胶代码的相关部分-尚不存在较便宜的解决方案.

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.

这篇关于如何将Sphinx生成的Latex代码集成到现有的Latex文档中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆