I want to indent all of the subsections my document. After some trial, error and reading I got the impression, that \list
is the way to do this (see MWE below). (Eventually, I want to absorb this into the \subsection
command, but for demonstration, this seems clearer). However, when a heading directly precedes the \begin{list}
(as is often the case for me), I get the error Something's wrong--perhaps a missing \item.
.
Adding \nointerlineskip\leavevmode
after \item\relax
(as suggested in this question) removes this error but breaks the spacing between the headings.
Why exactly do I get the error message? How can I avoid it without breaking the spacing between the headings?
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\section{foo}
\lipsum[4]
% uncommenting the following \section causes an error:
%\section{foo}
\begin{list}{}{\advance\leftskip 5ex}
\item\relax
\subsection{bar}
\lipsum[4]
\[
a^n + b^n = c^n
\]
\lipsum[2]
\begin{enumerate}
\item one
\item two
\item three
\end{enumerate}
\end{list}
\lipsum[4]
\end{document}
\section
etc. should not appear in alist
– user31729 Dec 2 '17 at 17:22