是否可以使用exsheets
带有 beamer 类的包?我尝试这样做,但是这段代码
\documentclass{beamer}
\usepackage{exsheets}
\begin{document}
\begin{frame}
test
\end{frame}
\end{document}
给出错误
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "xparse/environment-already-defined"
!
! Environment 'solution' already defined!
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................
应该做什么才能使exsheets
包正常工作beamer
?
答案1
为了能够exsheets
定义它的solution
环境,您需要通过让宏来“删除”beamer
的环境:solution
\solution
\relax
\let\solution\relax
如果您还想同时使用beamer
的solution
环境,exsheets
则需要先保存宏\solution
并执行以下操作\endsolution
:
\let\beamersolution\solution
\let\endbeamersolution\endsolution
完整示例:
\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}