Skip to content

Commit b2d9b00

Browse files
committed
Fix alignment of chapter titles and numbers
1 parent c87c14e commit b2d9b00

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

‎thesis.cls‎

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
\RequirePackage{subcaption}
4040
\RequirePackage{ragged2e}
4141
\RequirePackage{ifoddpage}
42+
\RequirePackage{adjustbox}
4243
\RequirePackage[xindy, toc, nopostdot]{glossaries}
4344
\RequirePackage{hyperref}
4445
% “… cleveref must be loaded *last*”
@@ -189,9 +190,6 @@
189190
\color{black}%
190191
\selectfont}
191192

192-
\newlength\thesis@chapter@width
193-
\newlength\thesis@chapter@orig
194-
195193
\titleformat{\chapter}
196194
{\gdef\chapterlabel{}}
197195
{\begingroup%
@@ -201,20 +199,17 @@
201199
{0pt}% Sep
202200
{\begingroup%
203201
\usekomafont{chapter}%
204-
\setlength\thesis@chapter@orig{\textwidth}%
205-
\setlength\thesis@chapter@width{\textwidth}%
206-
\addtolength\thesis@chapter@width{\marginparwidth}%
207-
\addtolength\thesis@chapter@width{\marginparsep}%
208202
\makebox[\textwidth][l]{%
209-
\begin{minipage}{\thesis@chapter@width}
210-
\begin{minipage}[t]{\thesis@chapter@orig}
211-
\hyphenpenalty=10000%
212-
\exhyphenpenalty=10000%
213-
\raggedright#1%
214-
\end{minipage}%
215-
\hspace{\marginparsep}%
216-
{\thesis@chapternumber\addfontfeature{Numbers=Lining}{\chapterlabel}}
217-
\end{minipage}}
203+
\begin{adjustbox}{minipage=\textwidth, valign=t}
204+
\hyphenpenalty=10000%
205+
\exhyphenpenalty=10000%
206+
\raggedright#1%
207+
\end{adjustbox}%
208+
\hspace{\marginparsep}%
209+
\begin{adjustbox}{minipage=\marginparwidth, valign=t}
210+
{\thesis@chapternumber\addfontfeature{Numbers=Lining}{\chapterlabel}}%
211+
\end{adjustbox}}
212+
\vspace{-\baselineskip}
218213
\endgroup%
219214
\setbox0\vbox{\use@preamble{chapter@u}%
220215
\vskip-\parskip}%

0 commit comments

Comments
 (0)