11

I'm trying to make an answer explanation guide for a test where the correct answer is "bubbled in".

I've tried using the enumitem package and tikz as shown in this post (Enumerated list with blue circles and number inside it), but it's messing up the default spacing and the counters of the other answer choices. This is what I have so far:

\documentclass{article}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
        \node[shape=circle,fill=blue!20,draw,inner sep=2pt] (char) {#1};}}

\usepackage{enumitem}

\begin{document}
\renewcommand{\labelenumi}{(\Alph{enumi})}
\begin{enumerate}
\item Answer A
\item[label=\circled{(\Alph*)}] Answer B
\item Answer C
\item Answer D
\item Answer E
\end{enumerate}

\end{document}

Ultimately what I want is something like this:

enter image description here

A transparent fill color would be nice. Thanks for any help.

7

You don't have to specify:

[label=\circled{(\Alph*)}]

but only:

[\circled{\Alph{enumi}}]

Moreover, it is also needed to advance the counter.

Therefore:

\documentclass{article}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%        
        \node[circle,fill=blue!20,draw,inner sep=2pt,opacity=0.5,text opacity=1] (char) {#1};}}

\def\cnt{\stepcounter{enumi}\Alph{enumi}}

\usepackage{enumitem}

\begin{document}
\renewcommand{\labelenumi}{(\Alph{enumi})}
\begin{enumerate}
\item Answer A
\item Answer B
\item[\circled{\cnt}] Answer C
\item Answer D
\item Answer E
\end{enumerate}

\end{document}

gives:

enter image description here

6

A different approach. The main problem with this solution is that the placement of the circle is too "manual", and different fonts would require a new manual adjust.

\documentclass{article}
\usepackage{tikz}
\usepackage{enumitem} 

\newcommand\correct{%
  \tikz[overlay]\fill[fill=green!50!black, opacity=.2] (-3ex,.6ex) circle (2ex);%
}

\begin{document}
\renewcommand{\labelenumi}{(\Alph{enumi})}
\begin{enumerate}
  \item Answer A
  \item\correct Answer B
  \item Answer C
  \item Answer D
  \item Answer E
\end{enumerate}
\end{document}

Result

  • You can play with \labelsep to get the the right placement with less of trial-end-error. – yo' Feb 20 '13 at 16:52
4

Another option, defining a dedicated command \citem and using the features provided by enumitem (instead of manually redefining \labelenumi):

\documentclass{article}
\usepackage{enumitem}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%        
        \node[circle,fill=blue!20,draw,inner sep=2pt,opacity=0.5,text opacity=1] (char) {#1};}}

\newcommand\citem{%
  \stepcounter{enumi}\item[\circled{\Alph{enumi}}]}

\begin{document}

\begin{enumerate}[label=(\Alph*)]
\item Answer A
\item Answer B
\citem Answer C
\item Answer D
\item Answer E
\end{enumerate}

\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.