如何在 Sphinx 乳胶中的父内容之后放置来自 toctree 的第一个内容

How to place included rst content from toctree after parent content in Sphinx latex

我正在编写用于生成 html 和乳胶输出的 sphinx 文档。

我的一些 rst 文件的结构如下:

My chapter title
=====================

.. toctree::
   :hidden:
   :maxdepth: 2

   folder/subchapter1
   folder/subchapter2


Chapter introduction
--------------------------
Brief introduction...

这在我的 html 输出中按预期工作 - 但对于我的乳胶构建,我在构建我的 pdf 时得到以下顺序:

My chapter title
subchapter1
[contents of subchapter 1]
subchapter2
[contents of subchapter 2]
Chapter introduction
Brief introduction...

预期顺序如下:

My chapter title
Chapter introduction
Brief introduction...
subchapter1
[contents of subchapter 1]
subchapter2
[contents of subchapter 2]

有什么方法可以通过 conf.py 告诉 sphinx 这应该是排序吗?

我发现解决方案只是将目录树向下移动到内容下方。