1

Given the following document:

\documentclass{article}
\usepackage{exercise}
\begin{document}
\begin{Exercise}
\end{Exercise}
\end{document}

How can I make the output ("Exercise 1") left-aligned? I've tried everything I could think of, from \flushleft and \raggedleft (from the ragged2e package) to reading the package documentation and trying to issue some \renewcommands, but nothing seems to work.

1 Answer 1

1

You have to redefine \ExerciseHeader:

\documentclass{article}
\usepackage{showframe} % just for the example
\usepackage{exercise}

\usepackage{lipsum} % just for the example

\renewcommand{\ExerciseHeader}{%
  \par\noindent
  \textbf{\large \ExerciseName\ExerciseHeaderNB\ExerciseHeaderTitle\ExerciseHeaderOrigin}%
  \par\nopagebreak\medskip
}

\begin{document}

\lipsum[1]

\begin{Exercise}
\lipsum[2]
\end{Exercise}

\end{document}

enter image description here

1
  • Great! I had to insert a space between \ExerciseName and \ExerciseHeaderNB so the exercise number isn't juxtaposed to its name, though. My document is much more legible now, thanks! Mar 11, 2016 at 5:26

You must log in to answer this question.

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