随机化投影仪演示文稿中幻灯片的顺序?

随机化投影仪演示文稿中幻灯片的顺序?

我在学习新科目时使用 Beamer 幻灯片为自己制作抽认卡。我想随机化幻灯片的显示顺序(这有助于我记忆)。

在 Beamer 中是否有简单的方法可以做到这一点?或者也许有一个可用的软件包?

似乎很少有可用的抽认卡文档类,但这些文档类似乎被设计成可以打印出抽认卡,因此没有“随机化”或“随机播放”选项。我不想打印抽认卡。我只想在屏幕上查看它们。

提前感谢任何帮助和建议!

答案1

基于如何在 LaTeX 中生成避免重复的随机问题列表?而且仍然很黑客。

第一张幻灯片将以一种语言显示该单词,下一张幻灯片将添加另一种语言的翻译。

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{pgfmath,pgffor}

\makeatletter
\def\pgfmathrandomitemwithoutreplacement#1#2{%
    \pgfmath@ifundefined{pgfmath@randomlist@#2}{\pgfmath@error{Unknown random list `#2'}}{%
        \edef\pgfmath@randomlistlength{\csname pgfmath@randomlist@#2\endcsname}%
        \ifnum\pgfmath@randomlistlength>0\relax%
            \pgfmathrandominteger{\pgfmath@randomtemp}{1}{\pgfmath@randomlistlength}%
            \def\pgfmath@marshal{\def#1}%
            \expandafter\expandafter\expandafter\pgfmath@marshal\expandafter\expandafter\expandafter{\csname pgfmath@randomlist@#2@\pgfmath@randomtemp\endcsname}%
            % Now prune.
            \c@pgfmath@counta=\pgfmath@randomtemp\relax%
            \c@pgfmath@countb=\c@pgfmath@counta%
            \advance\c@pgfmath@countb by1\relax%
            \pgfmathloop%
            \ifnum\c@pgfmath@counta=\pgfmath@randomlistlength\relax%
            \else%
                \def\pgfmath@marshal{\expandafter\global\expandafter\let\csname pgfmath@randomlist@#2@\the\c@pgfmath@counta\endcsname=}%
                \expandafter\pgfmath@marshal\csname pgfmath@randomlist@#2@\the\c@pgfmath@countb\endcsname%
                \advance\c@pgfmath@counta by1\relax%
                \advance\c@pgfmath@countb by1\relax%
            \repeatpgfmathloop%
            \advance\c@pgfmath@counta by-1\relax%
            \expandafter\xdef\csname pgfmath@randomlist@#2\endcsname{\the\c@pgfmath@counta}%        
        \else%
            \pgfmath@error{Random list `#2' is empty}%
        \fi%        
    }}


\def\pgfmathrandomlistcopy#1#2{%
    \pgfmath@ifundefined{pgfmath@randomlist@#2}{\pgfmath@error{Unknown random list `#2'}}{%
        \edef\pgfmath@randomlistlength{\csname pgfmath@randomlist@#2\endcsname}%
        \pgfmathloop%
        \ifnum\pgfmathcounter>\pgfmath@randomlistlength\relax%
        \else%
            \def\pgfmath@marshal{\expandafter\global\expandafter\let\csname pgfmath@randomlist@#1@\pgfmathcounter\endcsname=}%
            \expandafter\pgfmath@marshal\csname pgfmath@randomlist@#2@\pgfmathcounter\endcsname%
        \repeatpgfmathloop%
        \expandafter\xdef\csname pgfmath@randomlist@#1\endcsname{\pgfmath@randomlistlength}%
    }%  
}
\makeatother


\begin{document}
\pgfmathsetseed{\number\pdfrandomseed} % seed for random generator

\pgfmathdeclarerandomlist{WordsMaster}{%
 {Canard \textcolor<1>{white}{Duck} }%
 {Poisson \textcolor<1>{white}{Fish} }%    
 {Chat \textcolor<1>{white}{Cat} }%          
}%

\newcommand*{\NumberOfQuizes}{3}%
\pgfmathrandomlistcopy{Words}{WordsMaster}

\foreach \QuizNumber in {1,...,\NumberOfQuizes} {%
    \pgfmathrandomitemwithoutreplacement{\RandomQuestion}{Words} 

\begin{frame}<1>
    \RandomQuestion
\end{frame}

\begin{frame}<2>
    \RandomQuestion
\end{frame}

}%

\end{document}

在此处输入图片描述

相关内容