Skip to content

Commit 3fb644b

Browse files
committed
Extend pdflatex config in sphinx.sty to subparagraphs
This addresses #2547. As the two Sphinx classes set secnumdepth to 2 by default, the label for paragraphs with the numbering is still skipped by default. But if user increases secnumdepth to 4 or higher it will show, contrarily to earlier situation. Also formerly paragraph headings used \small, which looks wrong because the body text did not use \small. And subparagraphs were not at all configured with \titleformat, thus did not use same font as other headings.
1 parent 1959dfe commit 3fb644b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sphinx/texinputs/sphinx.sty

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,12 @@
454454
{\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
455455
\titleformat{\subsubsection}{\py@HeaderFamily}%
456456
{\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor}
457-
\titleformat{\paragraph}{\small\py@HeaderFamily}%
458-
{\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor}
457+
% By default paragraphs (and subsubsections) will not be numbered because
458+
% sphinxmanual.cls and sphinxhowto.cls set secnumdepth to 2
459+
\titleformat{\paragraph}{\py@HeaderFamily}%
460+
{\py@TitleColor\theparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor}
461+
\titleformat{\subparagraph}{\py@HeaderFamily}%
462+
{\py@TitleColor\thesubparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor}
459463

460464
% {fulllineitems} is the main environment for object descriptions.
461465
%

0 commit comments

Comments
 (0)