From eb8ae741c24ebebbd0b6561e9ab5d8d99d513e04 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 27 Sep 2024 00:09:11 +0200 Subject: [PATCH] [styles] Format title of \codeblocktu using 'caption' package This restores the C++20 status of the formatting. --- source/macros.tex | 16 ---------------- source/styles.tex | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index d54104139d..f257575dca 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -587,22 +587,6 @@ \lstnewenvironment{codeblock}{\CodeBlockSetup}{} -% Left-align listings titles -\makeatletter -\def\lst@maketitle{\@makeleftcaption\lst@title@dropdelim} -\long\def\@makeleftcaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1: #2}% - \ifdim \wd\@tempboxa >\hsize - #1: #2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{%\hfil -- REMOVED - \box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}% -\makeatother - \lstnewenvironment{codeblocktu}[1]{% \lstset{title={%\parabullnum{Bullets1}{0pt} #1:}}\CodeBlockSetup}{} diff --git a/source/styles.tex b/source/styles.tex index e6372565cd..715825cb74 100644 --- a/source/styles.tex +++ b/source/styles.tex @@ -121,10 +121,10 @@ leftmargin=\bnfindentrest, listparindent=-\bnfindentinc, itemindent=\listparindent} %%-------------------------------------------------- -%% set caption style -\captionstyle{\centering} +%% set caption styles \DeclareCaptionLabelSeparator{emdash}{ --- } -\captionsetup{labelsep=emdash,font+=bf} +\captionsetup{justification=centering,labelsep=emdash,font+=bf} +\captionsetup[lstlisting]{justification=raggedright,singlelinecheck=false,font=normal} %%-------------------------------------------------- %% set global styles that get reset by \mainmatter