# Exam class: TikZ-circled choices not aligned to hanging indent

I am typesetting a competition examination paper, and I wanted to satisfy a very specific requirement for the multiple-choice questions: five choices, each with capital letter choice labels all in equal-sized circles with the labels smack in the centres of the circles, and all aligned to the question text hanging indent. It took me a while, but I have thus far combined the (excellent, detailed and clean) solutions in the following threads:

And thus I have the following MWE:

\documentclass[preview, class=exam,varwidth=true]{standalone}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
\node[shape=circle, draw, minimum size=1.5em, inner sep=0pt, label={center:#1}, thick] (char) {#1};}}
\renewcommand\choicelabel{%
\circled{\thechoice}}
\renewcommand{\questionshook}{%
\settowidth{\leftmargin}{0pt}}
\renewcommand{\choiceshook}{%
\settowidth{\leftmargin}{W.\hskip\labelsep\hskip 0em}}

\begin{document}

\begin{questions}

\begin{EnvUplevel}
Welcome to the competition.
\end{EnvUplevel}

\question This is an example of a question.
\begin{choices}
\choice This is Choice A.
\choice This is Choice B.
\choice This is Choice C.
\choice This is Choice D.
\choice This is Choice E.
\end{choices}
\end{questions}
\end{document}


The thing is, the circles now appear to exceed the hanging indent of the question text and are a bit too far to the left, as shown by the black line I've added in mspaint. I would like the left edges of the circles to coincide precisely with the hanging indent of the question text; how may I go about doing this?

• Unrelated: label={center:#1} isn't needed, because you have #1 in the node contents as well, so you end up printing the label twice, in the same place. – Torbjørn T. Jan 19 '19 at 14:47
• Probably not a good fix, but you could change 0em to 3pt (or thereabouts). – Torbjørn T. Jan 19 '19 at 14:53

Here is a proposal. I only changed

 \renewcommand{\choiceshook}{\settowidth{\leftmargin}{\circled{W}.\hskip\labelsep\hskip 0em}}


to change the indent. Big thanks to Torbjørn T. for pointing out that I misread a requirement before.

\documentclass[preview, class=exam,varwidth=true]{standalone}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
\node[shape=circle, draw, minimum size=1.5em, inner sep=0pt , thick] (char) {#1};}}
\renewcommand\choicelabel{\circled{\Alph{choice}}}
\renewcommand{\questionshook}{%
\settowidth{\leftmargin}{0pt}}
\renewcommand{\choiceshook}{\settowidth{\leftmargin}{\circled{W}.\hskip\labelsep\hskip 0em}}

\begin{document}

\begin{questions}

\begin{EnvUplevel}
Welcome to the competition.
\end{EnvUplevel}

\question This is an example of a question.
\begin{choices}
\choice This is Choice A.
\choice This is Choice B.
\choice This is Choice C.
\choice This is Choice D.
\choice This is Choice E.
\end{choices}
\end{questions}
\end{document}


• Thanks for the answer! However, I used @Torbjørn T.'s solution (the correct indent was actually 6pt) to achieve perfect alignment with the choices that the oneparchoices environment creates. – SRSR333 Jan 20 '19 at 4:03