Skip to content

Commit afdd158

Browse files
jensmaurertkoeppe
authored andcommitted
[styles] Format title of \codeblocktu using 'caption' package
This restores the C++20 status of the formatting.
1 parent da5fa31 commit afdd158

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

source/macros.tex

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -587,22 +587,6 @@
587587

588588
\lstnewenvironment{codeblock}{\CodeBlockSetup}{}
589589

590-
% Left-align listings titles
591-
\makeatletter
592-
\def\lst@maketitle{\@makeleftcaption\lst@title@dropdelim}
593-
\long\def\@makeleftcaption#1#2{%
594-
\vskip\abovecaptionskip
595-
\sbox\@tempboxa{#1: #2}%
596-
\ifdim \wd\@tempboxa >\hsize
597-
#1: #2\par
598-
\else
599-
\global \@minipagefalse
600-
\hb@xt@\hsize{%\hfil -- REMOVED
601-
\box\@tempboxa\hfil}%
602-
\fi
603-
\vskip\belowcaptionskip}%
604-
\makeatother
605-
606590
\lstnewenvironment{codeblocktu}[1]{%
607591
\lstset{title={%\parabullnum{Bullets1}{0pt}
608592
#1:}}\CodeBlockSetup}{}

source/styles.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@
121121
leftmargin=\bnfindentrest, listparindent=-\bnfindentinc, itemindent=\listparindent}
122122

123123
%%--------------------------------------------------
124-
%% set caption style
125-
\captionstyle{\centering}
124+
%% set caption styles
126125
\DeclareCaptionLabelSeparator{emdash}{ --- }
127-
\captionsetup{labelsep=emdash,font+=bf}
126+
\captionsetup{justification=centering,labelsep=emdash,font+=bf}
127+
\captionsetup[lstlisting]{justification=raggedright,singlelinecheck=false,font=normal}
128128

129129
%%--------------------------------------------------
130130
%% set global styles that get reset by \mainmatter

0 commit comments

Comments
 (0)