Open cpitclaudel opened 6 years ago
I think LaTeX should use \part
for that (for toplevel toctree
). I.E. LaTeX should look something like
\begin{document}
\maketitle
\sphinxtableofcontents
\phantomsection\label{\detokenize{index::doc}}
\part{AAA}
\label{detokenize{index::toctree_aaa}}
\chapter{A1}
\label{\detokenize{index::toctree_aaa::a1}}
\chapter{A2}
\label{\detokenize{index::toctree_aaa::a2}}
\part{BBB}
\label{detokenize{index::toctree_bbb}}
\chapter{B1}
\label{\detokenize{index::toctree_bbb::b1}}
\chapter{B2}
\label{\detokenize{index::toctree_bbb::b2}}
\renewcommand{\indexname}{Index}
\printindex
\end{document}
but also the Table of Contents Heading should not be AAA
. Here is with such manual modifications:
I added the :caption:
option for toctree to show a caption in content. But I did not intend to show it in ToC. So I feel the captions should not appear in sidebar.
Anyway, as discussed in #4733 (and other issues labeled as toctree
), "Part like" ToC mechanism is needed by some users.
Was there a resolution to this issue?
I added the
:caption:
option for toctree to show a caption in content. But I did not intend to show it in ToC. So I feel the captions should not appear in sidebar.Anyway, as discussed in #4733 (and other issues labeled as
toctree
), "Part like" ToC mechanism is needed by some users.
@tk0miya : could you provide some clarification on this? I've been using some themes that make use of the :caption:
directive as a way of creating section headers in TOC in the resulting HTML. Though, as experienced by @cpitclaudel, two problems occur:
:caption:
content for multiple toctrees.:caption:
ends up becoming the TOC header in a resulting PDF, while ignoring the rest of the :caption:
values in the toctrees.Note: Another open issue seems to be attempting a similar goal in #3357
Is there current guidance in how users can accomplish this goal at the moment:
.. toctree::
:caption: AAA
A1
A2
.. toctree::
:caption: BBB
B1
B2
In order to achieve both captioned sections with make html
and TOC captioned sections with pdf gen?
I'm using:
At present, no way to do that. I'll work on it nearly future (after the refinement of autodoc and autosummary...)
Hi, any progress on this issue?
looking forward to seeing a solution where multiple toctree captions are converted to 'part' in latex.
In case somebody is still looking for a way to generate LaTeX \part{}
s from different toctree
s in Sphinx, there is a workaround from 2016 posted in https://github.com/sphinx-doc/sphinx/issues/3169#issuecomment-262175220
Problem
The HTML builder has good support for multiple separate
toctree
s with captions, like this:In Alabaster it's rendered like this:
And in the RTD theme
A1
andA2
are grouped in the table of contents:The LaTeX builder, on the other hand, gets confused when presented with the same input:
Procedure to reproduce the problem
Expected results
The table of contents should be split into two parts in LaTeX like in HTML
Environment info