2

When using enumerate inside the answers package to generate a list of exercises the first item is not correctly indented compared to all other items which come after it. Is it possible to use enumerate within the answers package and obtain correct alignment for all items?

Here is my MWE.

\documentclass{memoir}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\renewcommand{\Solutionlabel}[1]{\small{#1.}}
\newtheorem{ex}{}[section]

\begin{document}
\begin{ex}
\begin{enumerate}
\item Part 1. of the first exercise which is not correctly aligned
  compared to all other subsequence items in the list.  
\item Part 2. of the first exercise.
\item Part 3. of the first exercise.
\end{enumerate}
\end{ex}
\begin{ex}
The next exercise.
\end{ex}

\end{document}
  • Welcome to TeX.SX! This has nothing to do with answers – user31729 Nov 3 '15 at 14:30
  • 1
    @omegadot -- Just add a ~ after the first \begin{ex} like this: \begin{ex}~ \begin{enumerate} ... \end{enumerate}. – AboAmmar Nov 3 '15 at 14:33
3

Either you specify some (explanatory) text after \begin{ex} or add the ~ character after \begin{ex}.

The 'problem' is due to the definition of ex and \newtheorem and not related to the answers package at all.

\documentclass{memoir}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\renewcommand{\Solutionlabel}[1]{\small{#1.}}
\newtheorem{ex}{Exercise}[section]

\begin{document}

\chapter{First} 
\section{First}
\begin{ex}~
\begin{enumerate}
\item Part 1. of the first exercise which is not correctly aligned
  compared to all other subsequence items in the list.  
\item Part 2. of the first exercise.
\item Part 3. of the first exercise.
\end{enumerate}
\end{ex}
\begin{ex} Or with some text
\begin{enumerate} 
\item Part 1. of the first exercise which is not correctly aligned
  compared to all other subsequence items in the list.  
\item Part 2. of the first exercise.
\item Part 3. of the first exercise.
\end{enumerate}
\end{ex}

\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.