File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 9
9
__all__ = ["TocTreePlusDirective" , "setup" ]
10
10
11
11
12
+ # TODO: The first section in a part has all sub sections nested under it in the sidebar,
13
+ # The numbering is correct, and its correct in the contents
14
+
12
15
class TocTreePlusDirective (sphinx .directives .other .TocTree ):
13
16
14
17
def run (self ) -> List [nodes .Node ]:
@@ -21,7 +24,9 @@ def run(self) -> List[nodes.Node]:
21
24
and self .env .docname == self .env .config .master_doc
22
25
):
23
26
24
- latex_part_node = nodes .raw (text = f"\\ part{{{ caption } }}" , format = "latex" )
27
+ # TODO: \setcounter{section}{0}
28
+ # https://tex.stackexchange.com/questions/271075/reset-counter-section-in-part
29
+ latex_part_node = nodes .raw (text = f"\\ setcounter{{section}}{{0}}\n \\ part{{{ caption } }}" , format = "latex" )
25
30
output .append (latex_part_node )
26
31
# self.state.nested_parse(StringList(), self.content_offset, latex_part_node)
27
32
You can’t perform that action at this time.
0 commit comments