0

This method to have a newline after the exercise heading usually works:

\newtheoremstyle{break}{}{}{}{}{\bfseries}{}{\newline}{}
\theoremstyle{break}
\newtheorem{exercise}[theorem]{Exercise}

\setlist[enumerate,1]{label=\arabic*),align=left,leftmargin=*}

\begin{exercise}
Hello
\end{exercise}

and gives:

Exercise 1
Hello

But when the exercise begins with an enumeration, it fails:

\begin{exercise}
\begin{enumerate}
\item Hello
\end{enumerate}
\end{exercise}

with:

Exercise 1 1) Hello

Question: how to have the newline after the exercise heading, even if starts with an enumerate?

Note:

5
  • Thank you @moewe. I edited the question to show why the first answers from the first link didn't work, probably specific to \newtheoremstyle{break}{}{}{}{}{\bfseries}{}{\newline}{} mode.
    – Basj
    May 30, 2018 at 10:35
  • Try \leavevmode\vspace{-\baselineskip}
    – moewe
    May 30, 2018 at 10:36
  • Do you think @moewe we could define this once for all in this definition \newtheoremstyle{break}{}{}{}{}{\bfseries}{}{\newline \leavevmode\vspace{-\baselineskip}}{} and avoid to have to think about it when we start an exercise with or without enumeration? (If so, you could post it as an answer).
    – Basj
    May 30, 2018 at 10:49
  • I'm no sure about the possible downsides in certain edge cases, so I'd rather not recommend it. Plus it seems excessive in the 'usual case'.
    – moewe
    May 30, 2018 at 12:02

1 Answer 1

2

As pointed here, this is the solution in this precise case:

\begin{exercise}
\begin{enumerate}
\item[]
\item First item

All the other answers don't really work in this specific case because they create new paragraphs, letting empty lines between the Exercise heading and the enumeration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .