1

I am working with the exam documentclass. How can I color the question numbers. That is, I want some question numbers to appear red. How would I go about it?

1
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Skillmon
    Dec 3, 2017 at 19:39

1 Answer 1

1

Probably this is what you want.

\documentclass{exam}
\usepackage{color}

\renewcommand{\questionlabel}{\color{red}\thequestion.}

\begin{document}
\begin{questions}
    \question Question
\end{questions}
\end{document}

enter image description here

Edit:

Scott Seidman noted that it changes all questions. If you want to change only one question number, you can use:

\documentclass{exam}
\usepackage{color}

\let\oldquestionlabel=\questionlabel

\begin{document}
\begin{questions}
    \renewcommand{\questionlabel}{\color{red}\thequestion.}
    \question Question 1
    \renewcommand{\questionlabel}{\oldquestionlabel}
    \question Question 2
\end{questions}
\end{document}

enter image description here

2
  • That does all the question numbers. The question is how to do some of them Dec 3, 2017 at 22:15
  • You are right, see the edited answer
    – bmv
    Dec 3, 2017 at 22:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .