0

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}
  • Something like \section etc. should not appear in a list – user31729 Dec 2 '17 at 17:22
  • Since the standard way of changing indentation seems to be with lists: Does this mean, I cannot (easily) indent parts of the document that contain sectioning commands? – schtandard Dec 2 '17 at 17:23
  • 1
    Regarding the error see tex.stackexchange.com/questions/237551/… – Ulrike Fischer Dec 2 '17 at 18:04
  • I suggest that you look into the titlesec package, it's quite versatile to control things like formatting and identation of sections etc. – Harry Dec 2 '17 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.