# Change title of question in exsheets

Is there any way to change the title of questions created with exsheets? I would like the title to be like "Lecture 1 - Exercise 1", instead of "Exercise 1".

• The "Lecture" counter can behave like sections, so that when I write something like \lecture or \lecture{1}, all subsequent exercises will have the corresponding lecture number. However, if that is not possible, manually writing the numbers will also be ok. – Aakash Jog Mar 18 '15 at 9:52

You can define a new counter lecturecount and increment it through a \lecture command.

Also, if you want the question counter to be reset at each lecture, load exsheets with the option counter-within = lecturecount.

Finally, redefine the question title by redefining the question-solution pair in this way

\RenewQuSolPair{question}[name=Lecture \thelecturecount\ -- Exercise]{solution}


MWE

\documentclass{article}
\newcounter{lecturecount}
\newcommand\lecture{\refstepcounter{lecturecount}}
\usepackage[counter-within = lecturecount]{exsheets}
\RenewQuSolPair{question}[name=Lecture \thelecturecount\ -- Exercise]{solution}

\begin{document}

\lecture

\begin{question}
foo
\end{question}

\begin{question}
bar
\end{question}

\begin{question}
baz
\end{question}

\lecture

\begin{question}
foo
\end{question}

\begin{question}
bar
\end{question}

\begin{question}
baz
\end{question}

\end{document}


Output:

• @AakashJog you're welcome. – karlkoeller Mar 18 '15 at 10:20
• Is it possible to somehow skip a question number? I would like the second lecture to start from Exercise 2. – Aakash Jog Mar 18 '15 at 10:23
• @AakashJog Put \setcounter{question}{1} just after the second \lecture – karlkoeller Mar 18 '15 at 10:26