# Encircle a question number

I wish to encircle the first question and third question only or i need to mark this is a favorite question by putting star on it. how do i do it??

\documentclass[]{exam}
\usepackage{amsmath,amsthm,amsfonts,amssymb,dsfont,tikz,mwe,caption,float}
\usepackage{pgf,tikz}
\usepgflibrary{arrows}
\begin{document}
\begin{questions}
\begin{minipage}{0.75\textwidth}
\question In the adjoining figure \ref{fig.3}.\thequestion, $\sin\theta=\frac{15}{17}$.  Then $BC=$
%\choice {85m}\choice{65m}\choice{95m}\choice{75m}
\end{minipage} %
\begin{minipage}{.15\textwidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=.60cm,y=.60cm]
\clip(-5,-1) rectangle (1,5);
\draw[] (0,0.59) -- (-0.59,0.59) -- (-0.59,0) -- (0,0) -- cycle;
\draw (0,0)-- (0,4);
\draw (0,4)-- (-3.84,0);
\draw (0,0)-- (-3.84,0);
\draw [shift={(-3.84,0)}] plot[domain=0:0.81,variable=\t]({1*0.97*cos(\t r)+0*0.97*sin(\t r)},{0*0.97*cos(\t r)+1*0.97*sin(\t r)});
\draw (-2.82,1.02) node[anchor=north west] {$\theta$};
\draw (-3.65,2.91) node[anchor=north west] {$85 m$};
\begin{scriptsize}
%\fill [] (0,0) circle (1.5pt);
\draw (0.34,-0.21) node {$B$};
% \fill [] (0,4) circle (1.5pt);
\draw (0.22,4.36) node {$C$};
%\fill [] (-3.84,0) circle (1.5pt);
\draw (-4.3,-0.29) node {$A$};
% \draw[] (-0.7,0.85) node {$90\textrm{\degre}$};
\end{scriptsize}
\end{tikzpicture}
\label{fig.3}
\end{minipage}

\begin{minipage}{.60\textwidth}
\question In the adjoining figure $\angle ABC=$
%\choice{$45\degre$}{$30\degre$}{$60\degre$}{$50\degre$}{}
\end{minipage} %
\begin{minipage}{.25\textwidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=.60cm,y=.60cm]
\clip(-3.2,-1) rectangle (5,4.5);
\draw[] (0.42,0) -- (0.42,0.42) -- (0,0.42) -- (0,0) -- cycle;
\draw (0,0)-- (0,4);
\draw (0,4)-- (4,0);
\draw (0,0)-- (4,0);
%\draw [shift={(4,0)}] plot[domain=2.36:π,variable=\t]({1*0.71*cos(\t r)+0*0.71*sin(\t r)},{0*0.71*cos(\t r)+1*0.71*sin(\t r)});
\draw (-3,2.26) node[anchor=north west] {$100\sqrt 3 \;m$};
\draw (1.52,0.08) node[anchor=north west] {$100\;m$};
\begin{scriptsize}
%\fill [color=xdxdff] (0,0) circle (1.5pt);
\draw[] (-0.5,0.26) node {$A$};
%\fill [color=xdxdff] (0,4) circle (1.5pt);
\draw[] (0.16,4.26) node {$C$};
%\fill [color=xdxdff] (4,0) circle (1.5pt);
\draw[] (4.42,0.48) node {$B$};
%\draw[] (0.78,0.5) node {$90\textrm{\degre}$};
\end{scriptsize}
\end{tikzpicture}
\end{minipage}

\question This is the third question...

\end{questions}

\end{document}

• Can you make your example more minimal? There's a lot of unnecessary cruft :) Feb 14 '15 at 16:29
• A note for potential answers: \question* isn't in use (yet?). Seems like a good candidate for xpatching. Feb 14 '15 at 16:33
• i wish to know that encircling is depening on putting the question inside a minipage or not.. that's i gave this codes.. Feb 14 '15 at 16:34
• If you are concerned about that, you can put the question in a minipage without including a TikZ figure :) Feb 14 '15 at 16:35

Here I create \circlenum and \starnum to lap the circle. I ovalized it to handle two digit question numbers, but you can tweak it. Likewise you can tweak the colors and sizes. EDITED for stars and circles.

\documentclass[]{exam}
\usepackage{amsmath,amsthm,amsfonts,amssymb,dsfont,tikz,mwe,caption,float}
\usepackage{pgf,tikz}
\def\circlenum{\leavevmode\llap{\smash{\scalebox{5}[4]{%
\raisebox{-1.8pt}{\textcolor{red}{$\circ$}}}}}}
\def\starnum{\leavevmode\llap{\smash{\scalebox{4}{%
\raisebox{-1pt}{\textcolor{red}{$\star~$}}}}}}
\usepgflibrary{arrows}
\begin{document}
\begin{questions}
\begin{minipage}{0.75\textwidth}
\question \circlenum%
In the adjoining figure \ref{fig.3}.\thequestion, $\sin\theta=\frac{15}{17}$.  Then $BC=$
%\choice {85m}\choice{65m}\choice{95m}\choice{75m}
\end{minipage} %
\begin{minipage}{.15\textwidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=.60cm,y=.60cm]
\clip(-5,-1) rectangle (1,5);
\draw[] (0,0.59) -- (-0.59,0.59) -- (-0.59,0) -- (0,0) -- cycle;
\draw (0,0)-- (0,4);
\draw (0,4)-- (-3.84,0);
\draw (0,0)-- (-3.84,0);
\draw [shift={(-3.84,0)}] plot[domain=0:0.81,variable=\t]({1*0.97*cos(\t r)+0*0.97*sin(\t r)},{0*0.97*cos(\t r)+1*0.97*sin(\t r)});
\draw (-2.82,1.02) node[anchor=north west] {$\theta$};
\draw (-3.65,2.91) node[anchor=north west] {$85 m$};
\begin{scriptsize}
%\fill [] (0,0) circle (1.5pt);
\draw (0.34,-0.21) node {$B$};
% \fill [] (0,4) circle (1.5pt);
\draw (0.22,4.36) node {$C$};
%\fill [] (-3.84,0) circle (1.5pt);
\draw (-4.3,-0.29) node {$A$};
% \draw[] (-0.7,0.85) node {$90\textrm{\degre}$};
\end{scriptsize}
\end{tikzpicture}
\label{fig.3}
\end{minipage}

\begin{minipage}{.60\textwidth}
\question In the adjoining figure $\angle ABC=$
%\choice{$45\degre$}{$30\degre$}{$60\degre$}{$50\degre$}{}
\end{minipage} %
\begin{minipage}{.25\textwidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=.60cm,y=.60cm]
\clip(-3.2,-1) rectangle (5,4.5);
\draw[] (0.42,0) -- (0.42,0.42) -- (0,0.42) -- (0,0) -- cycle;
\draw (0,0)-- (0,4);
\draw (0,4)-- (4,0);
\draw (0,0)-- (4,0);
%\draw [shift={(4,0)}] plot[domain=2.36:π,variable=\t]({1*0.71*cos(\t r)+0*0.71*sin(\t r)},{0*0.71*cos(\t r)+1*0.71*sin(\t r)});
\draw (-3,2.26) node[anchor=north west] {$100\sqrt 3 \;m$};
\draw (1.52,0.08) node[anchor=north west] {$100\;m$};
\begin{scriptsize}
%\fill [color=xdxdff] (0,0) circle (1.5pt);
\draw[] (-0.5,0.26) node {$A$};
%\fill [color=xdxdff] (0,4) circle (1.5pt);
\draw[] (0.16,4.26) node {$C$};
%\fill [color=xdxdff] (4,0) circle (1.5pt);
\draw[] (4.42,0.48) node {$B$};
%\draw[] (0.78,0.5) node {$90\textrm{\degre}$};
\end{scriptsize}
\end{tikzpicture}
\end{minipage}

\question \starnum This is the third question...

\end{questions}

\end{document}


POSTSCRIPT:

here is a definition of a more general

\newcommand\shapenum[2][2]{\leavevmode\llap{\smash{\scalebox{#1}{%
\raisebox{-1pt}{\textcolor{red}{$#2$}}}}\hspace{6mm}}}


It takes a scale factor as an optional argument, and a math-mode symbol as the primary argument. Examples would be:

\question\shapenum[2]{\bullet} ...


or

\question\shapenum{\square} ...


Of course, color is fixed here, but more parameters could be added to the macro to handle that as a setting.

• If i want to put star instead of circle, is there any solutions. Means if i want make any other shape instead of circle, can i???? Feb 14 '15 at 16:40
• @David Please see my revision. Feb 14 '15 at 16:45
• @David I added a POSTSCRIPT to my answer to give you more ideas. Feb 14 '15 at 16:57
• where we can learn defining these new environments???@steven Feb 14 '15 at 17:49
• @David These are not environments the way I have defined them (which are delimited by \begin{}...\end{}), but macros, invoked by \somename. This site is full of information, which can be searched. Also, the TeXbook and Latex User Guide are references each LaTeX user should have access to. Each of the commands used in my macro, for example \leavevmode, \llap, \smash, \scalebox, \raisebox, and \textcolor can be searched on this site to see what they are used for and how people use them in different ways. Best wishes. Feb 14 '15 at 19:03