# beamer + exsheets package

Is it possible to use exsheets package with beamer class? I try to do so, but this piece of code

\documentclass{beamer}
\usepackage{exsheets}

\begin{document}

\begin{frame}
test
\end{frame}

\end{document}


gives an error

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
!
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................


What should be done to make exsheets package work with beamer?

• It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The StackExchange staff can merge them together for you. – Werner Jul 5 '14 at 4:32

In order for exsheets to be able to define its solution environment you need to “delete” beamer's solution environment by letting the macro \solution to \relax:

\let\solution\relax


If you also want to be able to use beamer's solution environment alongside exsheets you'd need to save the macros \solution and \endsolution first:

\let\beamersolution\solution
\let\endbeamersolution\endsolution


A complete example:

\documentclass{beamer}

% save beamer's solution' environment as beamersolution':
\let\beamersolution\solution
\let\endbeamersolution\endsolution

% "delete" the solution' environment:
\let\solution\relax

\usepackage{exsheets}

\begin{document}

\begin{frame}
\begin{question}
A question.
\end{question}
\begin{solution}[print]
The solution.
\end{solution}
\begin{beamersolution}
The original \texttt{solution} environment.
\end{beamersolution}
\end{frame}

\end{document}
`