# LaTeX Exam package: Align choices with oneparchoices [duplicate]

This question already has an answer here:

I'm a fairly new LaTeX user, so please excuse me if this is a simple newbie question.

I am using the exam package to create, well, an exam. I use both the \choices and \oneparchoices environments and I would like them to be aligned instead of the choices ones being far more indented. This MWE should illustrate my point:

\documentclass{exam}

\begin{document}

\begin{questions}

\question
Question 1

\begin{oneparchoices}
\end{oneparchoices}

\question
Question 2

\begin{choices}
\end{choices}

\end{questions}

\end{document}


I'm sure the more experienced users can solve this easily, but I'm stuck.

## marked as duplicate by Stefan Pinnow, Kurt, Raaja, flav, JouleVApr 19 at 4:51

• did you try the \noindent command after \begin{choice}? – Yorgos Jan 18 at 8:21
• @Yorgos: As choices is a list environment \noindent will not work. The indention is done using \leftmargin not \indent. – Martin Scharrer Jan 18 at 8:50
• @Yorgos. Yes, I tried that. Should have mentioned it. – andhewoulddarkenthememory Jan 18 at 9:04
• I think this answer is much better than the currently selected one for this question: tex.stackexchange.com/a/108513/69346 – ThoAppelsin Apr 18 at 18:34
• Thanks, @ThoAppelsin! That works even better. – andhewoulddarkenthememory 2 days ago

Having a look at the source code of the exam class shows me that the left margin (realized as \leftmargin in LaTeX) is set by choices using a hard coded line \settowidth{\leftmargin}{W.\hskip\labelsep\hskip 2.5em}%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).

I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between \makeatletter and \makeatother, and change the above line to \setlength{\leftmargin}{<your prefered length>}. I would recommend here 15pt which is the normal \parindent. Your can't apparently not use \parindent directly as the list environment in choices seems to redefine it.

\documentclass{exam}

\makeatletter
% from exam.cls, line 4107:
\renewenvironment{choices}%
{\list{\choicelabel}%
{\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}%
\setlength{\leftmargin}{15pt}%
\def\choice{%
\if@correctchoice
\color@endgroup
\endgroup
\fi
\item
\do@choice@pageinfo
} % choice
\def\CorrectChoice{%
\if@correctchoice
\color@endgroup
\endgroup
\fi
\ifhmode \unskip\unskip\unvbox\voidb@x \fi
\begingroup \color@begingroup \@correctchoicetrue
\CorrectChoice@Emphasis
\fi
\item
\do@choice@pageinfo
} % CorrectChoice
\let\correctchoice\CorrectChoice
\topsep=0pt
\partopsep=0pt
\choiceshook
}%
}%
{\if@correctchoice \color@endgroup \endgroup \fi \endlist}
\makeatother

\begin{document}

\begin{questions}

\question
Question 1

\begin{oneparchoices}
\end{oneparchoices}

\question
Question 2

\begin{choices}