To do the same thing in the memoir
class, use the \sethangfrom{}
command, as follows:
\documentclass{memoir}
\setsecnumdepth{subsection}
\sethangfrom{\noindent #1}
\begin{document}
\chapter{Lorem ipsum dolor sit amet}
\section{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
Lorem ipsum dolor sit amet.
\subsection{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
Lorem ipsum dolor sit amet.
\end{document}
Note that this macro will affect all the lower-level sectioning commands at once.
Output:
If you want to change just one section level (say, subsections but not sections), use the \setNhook{}
macro, where N
refers to the short name of the sectioning command. Here is a list of commands to use:
Section type |
Short name |
Command |
section |
sec |
\setsechook{\sethangfrom{\noindent ##1}} |
subsection |
subsec |
\setsubsechook{\sethangfrom{\noindent ##1} } |
subsubsection |
subsubsec |
\setsubsubsechook{\sethangfrom{\noindent ##1}} |
para |
paragraph |
\setparahook{\sethangfrom{\noindent ##1}} |
subpara |
subparagraph |
\setsubparahook{\sethangfrom{\noindent ##1}} |
Note that the argument must be preceded with two pound signs (##) instead of one.
The following code formats subsections as block text, but creates the default hanging indent for sections:
\documentclass{memoir}
\setsecnumdepth{subsection}
\setsubsechook{\sethangfrom{\noindent ##1}}
\begin{document}
\chapter{Lorem ipsum dolor sit amet}
\section{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
Lorem ipsum dolor sit amet.
\subsection{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
Lorem ipsum dolor sit amet.
\end{document}
Output: