创建矩阵形式的游戏 - 独立

创建矩阵形式的游戏 - 独立

我有以下代码:

\documentclass{standalone}

\usepackage{sgame}
\usepackage{sgamevar}

\begin{document}

\begin{game}{3}{3}[P1][P2]
\> $\alt<6,7>{\textcolor{white}{L}}{L}$    \> $\alt<7>{\textcolor{unime}{C}}{C}$   \> $\alt<4,5,6,7>{\textcolor{white}{R}}{R}$\\
$\alt<3,4,5,6,7>{\textcolor{white}{U}}{U}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{0,2}}{0,2}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{3,1}}{3,1}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{2,3}}{2,3}$\\
$\alt<5,6,7>{\textcolor{white}{M}}{M}$ \> $\alt<5,6,7>{\textcolor{white}{1,4}}{1,4}$ \> $\alt<5,6,7>{\textcolor{white}{3,2}}{3,2}$ \> $\alt<4,5,6,7>{\textcolor{white}{4,1}}{4,1}$ \\
$\alt<7>{\textcolor{unime}{D}}{D}$ \> $\alt<6,7>{\textcolor{white}{2,1}}{2,1}$ \> $\alt<7>{\textcolor{unime}{4,4}}{4,4}$ \> $\alt<4,5,6,7>{\textcolor{white}{3,2}}{3,2}$
\end{game}

\end{document}

基本上,当我在 Beamer 演示文稿中使用它时,它工作正常。但当我想将其创建为独立文档时,我收到以下错误消息:

! Undefined control sequence.
<recently read> \alt 

l.9       \> $\alt
                  <6,7>{\textcolor{white}{L}}{L}$    \> $\alt<7>{\textcolor{...

有人知道为什么会发生这种情况吗?我也用过

\usepackage{standalone}

但仍然不起作用。提前致谢

答案1

\alt是由 定义的宏beamer,实际上只在该类中有意义,我不确定您希望覆盖规范在 中做什么standalone。无论如何,您可以加载beamerarticle包,它定义了beamer特定的宏,以便它们可以在其他类中使用。

\documentclass{standalone}
\usepackage{beamerarticle}
\colorlet{unime}{blue}
\usepackage{sgame}
\usepackage{sgamevar}

\begin{document}

\begin{game}{3}{3}[P1][P2]
\> $\alt<6,7>{\textcolor{white}{L}}{L}$    \> $\alt<7>{\textcolor{unime}{C}}{C}$   \> $\alt<4,5,6,7>{\textcolor{white}{R}}{R}$\\
$\alt<3,4,5,6,7>{\textcolor{white}{U}}{U}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{0,2}}{0,2}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{3,1}}{3,1}$ \> $\alt<3,4,5,6,7>{\textcolor{white}{2,3}}{2,3}$\\
$\alt<5,6,7>{\textcolor{white}{M}}{M}$ \> $\alt<5,6,7>{\textcolor{white}{1,4}}{1,4}$ \> $\alt<5,6,7>{\textcolor{white}{3,2}}{3,2}$ \> $\alt<4,5,6,7>{\textcolor{white}{4,1}}{4,1}$ \\
$\alt<7>{\textcolor{unime}{D}}{D}$ \> $\alt<6,7>{\textcolor{white}{2,1}}{2,1}$ \> $\alt<7>{\textcolor{unime}{4,4}}{4,4}$ \> $\alt<4,5,6,7>{\textcolor{white}{3,2}}{3,2}$
\end{game}

\end{document}

相关内容