I want the titles of sections and subsection to align on the same line (red in the picture):
How can I do it, preferably, without a package (titlesec for example)? I.e., by modifying the commands \@seccntformat
and/or \@startsection
?
In the following MWE, I insert the same \hskip
after \thesection
AND \thesubsection
:
\documentclass{book}
\makeatletter
\renewcommand{\@seccntformat}[1]{%
\csname the#1\endcsname\hskip 15pt}
\makeatother
\begin{document}
\section{one}
\subsection{a}
Lorem ipsum, text text text
\section{two}
\subsection{b}
\end{document}