I am trying to centre chapter, section and subsection using memoir
, with the following code:
\renewcommand{\chapnamefont}{\centering\normalfont}
\renewcommand{\chapnumfont}{\centering\normalfont}
\renewcommand\chaptitlefont{\centering\LARGE\normalfont}
\renewcommand\secheadstyle{\centering\Large\normalfont\noindent}
This works, but when the section title is longer than one line, the second one isn't centred anymore to the middle of the page, but only to the middle of the first line minus the space that is occupied by the section numbers. How to centre all lines of the section titles to the middle of the page?
Here is a working example:
\documentclass[a4paper,10pt,twoside]{memoir}
\usepackage{polyglossia}
\setmainlanguage[spelling=old,babelshorthands=true,script=latin]{german}
\usepackage{blindtext}
\usepackage{fontspec}
\renewcommand{\chapnamefont}{\centering\normalfont}
\renewcommand{\chapnumfont}{\centering\normalfont}
\renewcommand\chaptitlefont{\centering\LARGE\normalfont}
\renewcommand\secheadstyle{\centering\Large\normalfont\noindent}
\begin{document}
\tableofcontents*
\chapter{Test, nothing else – Don't waste your time reading this! It has to have two lines}
\section{Don't waste your time reading this! It has to have two lines. It has to have two lines}
\Blindtext
\footnote{\blindtext}
\blindtext
\section{Test124}
\Blindtext
\chapter{Test2}
\Blindtext \Blindtext \Blindtext
\end{document}
\hangsecnum
is a possible solution to your centering problem?