我正在 Beamer 上创建问答幻灯片。使用 Beamer 的叠加,我希望按照以下顺序显示不同的内容:
- 陈述问题和可能的答案
- 添加计算
checkmark
在正确答案上覆盖绿色
到目前为止我只得到了这个结果。所以第三段需要改进。
\documentclass{beamer}
\usepackage{xcolor,pifont}
\newcommand*\colourcheck[1]{%
\expandafter\newcommand\csname #1check\endcsname{\textcolor{#1}
{\ding{52}}}%
}
\colourcheck{green}
\begin{document}
\begin{frame}
\frametitle{Percent}
\begin{itemize}
\item If the production of hybrid cars tripled last year,
by how many percent did it increase?
\end{itemize}
\centering
\begin{minipage}{0.795\textwidth}
\begin{columns}
\begin{column}{0.2\textwidth}
\begin{enumerate}[(A)]
\item 100\%
\item[\only<1-2>{(B)}\only<3>{\makebox[-11pt]
{(B)}\greencheck}]200\%
\item 300\%
\item 400\%
\item 500\%
\end{enumerate}
\end{column}
\begin{column}<+(1)->{0.8\textwidth}
For example, if production was 10 cars, and it
tripled to 30 cars, the increase was 20 cars, which
is 200\% of 10. \bigskip
$\displaystyle \dfrac{30-10}{10} \times 100\% = \dfrac{20}{10} \times
100\% = 200\%$
\end{column}
\end{columns}
\end{minipage}
\end{frame}
\end{document}
基本上,我希望 (B) 字母保留在幻灯片中,并在“第三张”幻灯片上覆盖一个绿色勾号符号。
勾选样式:选择增加/减少其尺寸+为符号添加黑色边框。
更新:使用此代码\item[\only<1-2>{(B)}\only<3>{\makebox[-11pt]{(B)} \greencheck}] 200\%
,但此代码没有正确枚举(B)后面的字母。
答案1
我认为,如果您不考虑枚举标签,您可以获得更好的结果。这仍然是手动的,但符合您的尝试。不过,它应该有效。
\documentclass{beamer}
\usepackage{xcolor,pifont}
\newcommand*\colourcheck[1]{%
\expandafter\newcommand\csname #1check\endcsname{\textcolor{#1}
{\ding{52}}}%
}
\colourcheck{green}
\begin{document}
\begin{frame}
\frametitle{Percent}
\begin{itemize}
\item If the production of hybrid cars tripled last year,
by how many percent did it increase?
\end{itemize}
\centering
\begin{minipage}{0.795\textwidth}
\begin{columns}
\begin{column}{0.2\textwidth}
\begin{enumerate}[(A)]
\item 100\%
\item 200\% \only<3>{\hspace{-7.5ex}\makebox[-11pt]{\greencheck}}
\item 300\%
\item 400\%
\item 500\%
\end{enumerate}
\end{column}
\begin{column}<+(1)->{0.8\textwidth}
For example, if production was 10 cars, and it
tripled to 30 cars, the increase was 20 cars, which
is 200\% of 10. \bigskip
$\displaystyle \dfrac{30-10}{10} \times 100\% = \dfrac{20}{10} \times
100\% = 200\%$
\end{column}
\end{columns}
\end{minipage}
\end{frame}
\end{document}
(动画由@marmot 提供)