8

I'm writing a multiple choice text in latex, and I've been having some problems with the identation. I successfully indented all my text using

\begin{enumerate}
{\setlength\itemindent{15pt}\item[1)] Select one of the following:}
\vspace{0.2cm}
{\setlength\itemindent{32pt}\item[a)] This is the answer a), which 
                                      is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[b)] This is the answer b), which 
                                      is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[c)] This is the answer c), which
                                      is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[d)] This is the answer d), which
                                      is not true unless you know it is.}
\itemsep0em
{\setlength\itemindent{32pt}\item[e)] This is the answer e), which
                                      is not true unless you know it is.}
\end{enumerate}

The big problem is that the text of each possible answer of the multiple choices, after the identifying letter, is not indented with respect to the letter. In other words, I get:

a) This is the answer a), which
is not true unless you know it is.

While what I really want is:

a) This is the answer a), which
   is not true unless you know it is.

Does anyone knows how to do this? I've searched for previous answers, but none of them dealt directly with the enumerate enviorment.

Thanks in advance!

0

2 Answers 2

10

You probably want to take a look through enumitem's documentation. That will cut out a ton of repeated code for your list formatting:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}

\begin{document}

\setlist[enumerate]{noitemsep}
% uncomment the line below to align first-level enumerated lists along the
% left margin
% \setlist[enumerate,1]{leftmargin=*}
\setlist[enumerate,2]{label={\alph*}),leftmargin=0em}
% aligns second-level enumerated lists with the first-level enumerated lists

\lipsum[1]
\begin{enumerate}
\item Select one of the following:
\begin{enumerate}
\item This is the answer a), which is not true unless you know it is. This is
      the answer a), which is not true unless you know it is.
\item This is the answer b), which is not true unless you know it is. This is
      the answer b), which is not true unless you know it is.
\end{enumerate}
\end{enumerate}

\end{document}

enter image description here

4
  • is there a way to ommit the indentation of the second nested list?
    – Néstor
    Jun 4, 2012 at 1:42
  • You want level 1 and 2 enumerated lists indented to the same absolute position? Jun 4, 2012 at 9:42
  • Something like that. However, I managed to do it by adding [leftmargin=NUMBERcm], where NUMBER goes according to the limits of the document :-). Maybe there's a more efficient way to do this?
    – Néstor
    Jun 5, 2012 at 0:03
  • See edited answer. There's an option in the code to align everything to the left margin if needed, too. Jun 5, 2012 at 1:27
4

Why don't you simply nest the enumerations like this?

\documentclass{article}
\usepackage{enumitem} %% for fancy stuff like itemsep..

\begin{document}
 \begin{enumerate}
\item{ Select one of the following:}
 \begin{enumerate}[itemsep=0pt]
 \item{This is the answer a), which is not true unless you know it is.}
 \item{This is the answer b), which is not true unless you know it is is not true unless you know it is.}
 \item{This is the answer c), which is not true unless you know it is.}
 \item{This is the answer d), which is not true unless you know it is.}
 \item{This is the answer e), which is not true unless you know it is.}
\end{enumerate}
\end{enumerate}

\end{document}
3
  • I've tried this and it doesn't work :-(.
    – Néstor
    Jun 4, 2012 at 0:03
  • 1
    @Néstor: I don't follow. Please give a full MWE with details of your comment doesn't work
    – user11232
    Jun 4, 2012 at 0:04
  • My bad, it worked. I had some libraries that didn't let the original code work :-).
    – Néstor
    Jun 5, 2012 at 0:05

You must log in to answer this question.

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