索引.rst
======================================
MyTitle
======================================
.. raw:: latex
\section*{MyTitle}
Some text
.. toctree::
:hidden:
:titlesonly:
:caption: Setup
setup_macos
setup_macos.md
```{contents} On this page:
```
# macOS setup
In this tutorial...
问题是关于 setup_macos.md 中的
{contents}
标签。
这会生成“本地”TOC。这在 HTML 文档中是可取的,但我不希望它出现在 Latexpdf 文档中。
如何将本地目录放入 HTML 页面,但在 LaTeX 输出中隐藏它?
将
contents
指令嵌套在 only
指令中。按照此处所述使用反引号:https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#nesting-directives.
````{only} html
```{contents} On this page:
```
````