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:
- Good way to make \textcircled numbers?
- Using circled numbers for answer choices in exam document class
- How can I draw circled integers with the same size by TikZ?
- Set indentation of choice in exam documentclass
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?
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.0em
to3pt
(or thereabouts).