This is follow up question from Section Numbering in "Convex Optimizaion" by Boyd et. al. with Koma Script.
Is it possible, using the scrbook class, to place the chapter (section) numbers in the margin and center the chapter (section) titles?
This is follow up question from Section Numbering in "Convex Optimizaion" by Boyd et. al. with Koma Script.
Is it possible, using the scrbook class, to place the chapter (section) numbers in the margin and center the chapter (section) titles?
This version implements requests and advice from comments.
\documentclass{scrbook}
\usepackage{lipsum}
\makeatletter
\renewcommand*{\chapterformat}{%
\chapappifchapterprefix{\nobreakspace}%
\llap{\thechapter\autodot\enskip%
}}
\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
{%
\normalfont\sectfont\nobreak\size@chapter{}%
\noindent\ifnumbered{chapter}{\chapterformat}\fi
\parbox[t]{\textwidth}{\centering\size@chapter{#1}}%
\nobreak\chapterheadendvskip\par
}}
\makeatother
\begin{document}
\tableofcontents
\chapter{Center}
\lipsum
\end{document}
% after {\nobreakspace}; moreover \size@chapter has no argument. Instead of a group with a setting of \parindent, just \noindent\mbox is sufficient.
– egreg
Aug 26 '14 at 23:09
\renewcommand\raggedsection\centering? – Johannes_B Aug 23 '14 at 17:45Note: when using
– Christopher Aug 23 '14 at 21:33koma-scriptyou should write\addtokomafont{disposition}{\centering}.