我想在 Sphinx 中包含 LaTeX 文档。Sphinx 的 HTML 构建过程不会包含使用 .. raw:: latex
指令链接的 LaTeX 文件。这是我的目录结构:
docs/
source/
importlatex.rst
index.rst
build/
tex/
texfile.tex
index.rst
的样子如下:
Welcome to documentation!
=========================
Contents:
.. toctree::
:maxdepth: 2
icnludelatex
and-other-stuff
icnludelatex.rst
看起来像:
Include Latex
=============
.. raw:: latex
:file: ../tex/texfile.tex
这个参考资料提供了包含HTML的示例
.. raw:: html
:file: inclusion.html
为什么会出现这种情况?
tex/
目录在source/
目录外,因此请将其移动到内部或将其作为源文件的附加路径添加到您的conf.py
中。 - Steve Piercy