File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,14 @@ def setup_latex_transforms(app: Sphinx) -> None:
68
68
# if using the sphinx-external-toc, we can look if parts are being specified
69
69
# TODO this should probably be made more robust
70
70
sitemap = getattr (app .config , "external_site_map" , None )
71
- if (
72
- sitemap is not None
73
- and sitemap .file_format == "jb-book"
74
- and len (sitemap .root .subtrees ) > 1
75
- ):
76
- app .config ["latex_toplevel_sectioning" ] = "part"
77
- app .env .jblatex_captions_to_parts = True
71
+ if sitemap is not None :
72
+ if sitemap .file_format == "jb-book" and len (sitemap .root .subtrees ) > 1 :
73
+ app .config ["latex_toplevel_sectioning" ] = "part"
74
+ app .env .jblatex_captions_to_parts = True
75
+ elif sitemap .file_format == "jb-book" :
76
+ app .config ["latex_toplevel_sectioning" ] = "chapter"
77
+ elif sitemap .file_format == "jb-article" :
78
+ app .config ["latex_toplevel_sectioning" ] = "section"
78
79
79
80
logger .info (
80
81
bold ("jupyterbook-latex v%s:" ) + "engine='%s', toplevel_section='%s'" ,
You can’t perform that action at this time.
0 commit comments