Skip to content

Commit f20f745

Browse files
authored
Fix block headings support for unnumbered paragraphs (#9542)
`block-headings: true` seems to break unnumbered paragraphs and subparagraphs. This is due to the fact, that the unnumbered version uses the star macros \paragraph* and \subparagraph*. See issue #6018 for details.
1 parent 3d0e2ef commit f20f745

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

data/templates/default.latex

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,28 @@ $if(beamer)$
354354
$else$
355355
$if(block-headings)$
356356
% Make \paragraph and \subparagraph free-standing
357+
\makeatletter
357358
\ifx\paragraph\undefined\else
358359
\let\oldparagraph\paragraph
359-
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
360+
\renewcommand{\paragraph}{
361+
\@ifstar
362+
\xxxParagraphStar
363+
\xxxParagraphNoStar
364+
}
365+
\newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}
366+
\newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}
360367
\fi
361368
\ifx\subparagraph\undefined\else
362369
\let\oldsubparagraph\subparagraph
363-
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
370+
\renewcommand{\subparagraph}{
371+
\@ifstar
372+
\xxxSubParagraphStar
373+
\xxxSubParagraphNoStar
374+
}
375+
\newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}
376+
\newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}
364377
\fi
378+
\makeatother
365379
$endif$
366380
$endif$
367381
$if(pagestyle)$

0 commit comments

Comments
 (0)