3

For reasons that are beside the point, I want to have both exercises,

Ex. 1.1, Ex. 1.2, Ex. 1.3, ...,

and problems

Prob. 1.1, Prob. 1.2, Prob. 1.3, ...

Maybe also Example 1.1, Example 1.2, ...

Problems will most usually come at the end of the chapter, after all exercises of that chapter, but I may intercalate them sometimes.

0

1 Answer 1

6

This is not possible with exsheets (and isn't going to be) but exsheets' official successor package xsim natively supports this:

\documentclass{article}
\usepackage{xsim}

\DeclareExerciseType{problem}{
  exercise-env = problem ,
  solution-env = answer ,
  exercise-name = Prob. ,
  solution-name = Answer ,
  exercise-template = default ,
  solution-template = default
}
\DeclareExerciseType{example}{
  exercise-env = example ,
  solution-env = hint ,
  exercise-name = Example ,
  solution-name = Hint ,
  exercise-template = default ,
  solution-template = default
}

\xsimsetup{
  exercise/name = Ex. ,
  exercise/within = section ,
  exercise/the-counter = \thesection.\arabic{exercise} ,
  problem/within  = section ,
  problem/the-counter = \thesection.\arabic{problem} ,
  example/within = section ,
  example/the-counter = \thesection.\arabic{example}
}

\begin{document}

\section{Foo}
\begin{exercise}
\end{exercise}

\begin{problem}
\end{problem}

\begin{exercise}
\end{exercise}

\begin{example}
\end{example}

\begin{exercise}
\end{exercise}

\begin{problem}
\end{problem}

\begin{example}
\end{example}

\end{document}

enter image description here

You must log in to answer this question.

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