# Manual exercise question numbering

I am using exercise package to list exercises/questions. I am defining exercise list like this:

\begin{ExerciseList}
\Exercise{Exercise title}

\ExeText
Some exercise introduction
\Question{First question}
\Question{Second question}
\Question{Third question}
\end{ExerciseList}


In the output questions are numbered like this:

1. First question


However my desire is to have following output:

(a) First question


Actually it would be best if I could manually define list letter for question as I anticipate some gaps in numbering later. For example \Question{e}{Some question}. From the package source I see that questions are translated to list items:

\def\@QuestionHeader{\item[{\makebox[0cm][r]{\begingroup\@getQuestionInfo%


However I am unsure on how to redefine the macro in order to accomplish my goal.. Any ideas or hints?

-
Welcome to TeX.sx! –  Kurt Feb 18 at 2:26

Good on you to look in the source code. Good on the package author to use good macro names that describe the intent. I guessed from your posted snippet that \QuestionNB might be the macro that typeset the question number. Searching the source file for that string found me:

% Presentation of Questions
%    \begin{macrocode}
\newcommand{\QuestionNB}{\arabic{Question}.\ }


Excellent! We know \QuestionNB sets the arabic representation of the value the Question counter, with period and space. So all you have to do is insert

\renewcommand{\QuestionNB}{(\alph{Question})\ }


into the preamble after \usepackage{exercise} and you'll get what you want.

\documentclass{article}
\usepackage{exercise}
\renewcommand{\QuestionNB}{(\alph{Question})\ }
\begin{document}
\begin{ExerciseList}
\Exercise{Exercise title}

\ExeText
Some exercise introduction
\Question{First question}
\Question{Second question}
\Question{Third question}
\end{ExerciseList}
\end{document}


-
Great! thank you :) –  Paulius Feb 18 at 13:50