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.

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%
\QuestionHeaderDifficulty\QuestionNB\endgroup}}]%
\begingroup\@getQuestionInfo\QuestionHeaderTitle\endgroup\ignorespaces}

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

share|improve this question
    
Welcome to TeX.sx! –  Kurt Feb 18 '13 at 2:26

1 Answer 1

up vote 3 down vote accepted

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}

sample code output

share|improve this answer
    
Great! thank you :) –  Paulius Feb 18 '13 at 13:50

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.