beamer + exsheets 包

beamer + exsheets 包

是否可以使用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

如果您还想同时使用beamersolution环境,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}

在此处输入图片描述

相关内容