cgnieder / xsim

eXercise Sheets IMproved
65 stars 20 forks source link

Solutions not printed #104

Closed GMS103 closed 2 years ago

GMS103 commented 2 years ago

Sorry if this is a stupid question, but I am unable to solve it. When defining a new exercise type, the solutions are not printed.

\documentclass{article}

\usepackage{xsim}

\xsimsetup{solution/print=true}

\DeclareExerciseType{problem}{
  exercise-env = problem ,
  solution-env = answer ,
  exercise-name = Problem ,
  solution-name = Answer ,
  exercise-template = default ,
  solution-template = default
}

\begin{document}

\begin{exercise}
  Plain exercise.
\end{exercise}
\begin{solution}
  Plain solution.
\end{solution}

\begin{problem}
  Plain problem.
\end{problem}
\begin{answer}
  Plain answer.
\end{answer}

\end{document}

gives test What am I doing wrong?

cgnieder commented 2 years ago

You need \xsimsetup{answer/print=true} (of course placed after the \DeclareExerciseType statement).

GMS103 commented 2 years ago

That was my mistake: I was putting \xsimsetup{answer/print=true} before the declaration (and getting an error). Thanks.