Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using code mentioned below : i'm able to circle question numbers :

\documentclass{exam}
\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,fill,inner sep=1.5pt, text=white] (char) {#1};}}
\renewcommand{\questionlabel}{\circled{\thequestion}}
\begin{document}
\begin{questions}
\question[4] Choose the correct reponse: 
\begin{choices} \choice Option A
\choice Option B
\choice Option C
\choice Option D
 \end{choices}
\end{questions}
\end{document}

But as question number increases from one digit to two digit number, circle size changes.

enter image description here

Can you suggest how can we've circle of constant size for all numbers. [1-100]

share|improve this question

1 Answer 1

up vote 9 down vote accepted

Give the node for the circled number a minimum size like in this approach.

\documentclass{exam}
\usepackage{tikz}

\newcommand*\circled[1]{%
  \tikz[baseline=(char.base)]
    \node[
      shape=circle,
      fill,
      inner sep=1.5pt,
      text=white,
      minimum size=1.5em
    ] (char) {#1};
}

\renewcommand{\questionlabel}{\circled{\thequestion}}
\begin{document}
  \begin{questions}
    \setcounter{question}{8}  % only to show the effect

    \question[4] Choose the correct reponse:
    \begin{choices} \choice Option A
      \choice Option B
      \choice Option C
      \choice Option D
    \end{choices}

    \question[4] Choose the correct reponse:
    \begin{choices} \choice Option A
      \choice Option B
      \choice Option C
      \choice Option D
    \end{choices}

    \question[4] Choose the correct reponse:
    \begin{choices} \choice Option A
      \choice Option B
      \choice Option C
      \choice Option D
    \end{choices}
  \end{questions}
\end{document}

enter image description here

share|improve this answer
    
Is it possible to specify the minimum size as, for example, "whatever the width of 30" is, or "whatever the width of 100" is? –  mrc Oct 21 '13 at 17:43
3  
@mrc: If I understand you right, you may replace 1.5em with \widthof{30} or \widthof{100}, respectively. –  Thorsten Donig Oct 21 '13 at 17:49
    
@ThorstenDonig Thank You, it's working perfectly –  Pawan Mude Oct 22 '13 at 4:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.