使用 Beamer 和 Musixtex 进行叠加

使用 Beamer 和 Musixtex 进行叠加

Beamer 中需要在 Musixtex 代码里面配置叠加(使用 onslide 或者 pause),基本代码如下:

\documentclass[aspectratio=169]{beamer}
\usepackage{musixtex}


\usepackage[T1]{fontenc}
\usepackage{emerald}%Fuente tipo mano para pizarra en Beamer
\usepackage[spanish]{babel}
%Paquetes para Beamer
\usepackage{calc}
\usepackage{ifthen}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgffor}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{adjustbox}%Para centrar tablas
\usepackage{xcolor}
\xdefinecolor{gray-undar}{RGB}{52,52,52}
\xdefinecolor{red-undar}{RGB}{179,35,79}
% set text colors for different objects
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{structure}{fg=white}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{alerted text}{fg=white}
\setbeamercolor{example text}{fg=white}
%% set fonts
\setbeamerfont{frametitle}{size=\Huge, series=\ECFAugie}
\setbeamerfont{framesubtitle}{size=\large, series=\ECFAugie}
\setbeamerfont{title}{size=\huge, series=\ECFAugie}
\setbeamerfont{author}{size=\large, series=\ECFAugie}
\setbeamerfont{date}{size=\large, series=\ECFAugie}
\setbeamerfont{institute}{size=\large, series=\ECFAugie}
\setbeamerfont{caption}{series=\ECFAugie}
%% Green Background Colour
\setbeamercolor{background canvas}{bg=green!18!black}
%% Random Dust Trails
\setbeamertemplate{background}{
    \begin{tikzpicture}
        \useasboundingbox (0,0) rectangle (\the\paperwidth, \the\paperheight); 
      \foreach \i in {1,...,30} {
            \pgfmathsetmacro{\x}{random(0,10000)/5000-1}%
            \pgfmathsetmacro{\y}{random(0,10000)/10000-0.1}%
            \pgfmathsetmacro{\r}{random(0,10000)/1000-5}%
            \rotatebox{\r}{
                %\pgftext[at=\pgfpoint{\x\paperwidth}{\y\paperheight}, left, base]{\includegraphics[width=\textwidth]{LOGO_UNDAR_PNG_RGB.png}}
            }
        }; 
    \end{tikzpicture}
}
%% use a small dash ('-') for a bulletpoint list
\setbeamertemplate{itemize item}{\usebeamercolor[fg]{item}\small\ECFAugie{-}}
%% Frametitle
\setbeamertemplate{frametitle}{
    \begin{beamercolorbox}{frametitle}
        \vskip17pt
        \usebeamerfont{frametitle}
        \insertframetitle \\
        \usebeamerfont{framesubtitle}\insertframesubtitle
    \end{beamercolorbox}
}
%% remove navigation symbols
\setbeamertemplate{navigation symbols}{}
%% Date in the Corner
\setbeamertemplate{headline}{
    \rotatebox{30}{
        \ifx\insertdate\empty\else        
            \hspace*{0.25cm}\ECFAugie\insertshortdate\hspace*{0.5cm}
        \fi
    }
    \vspace*{-1cm}
}

\begin{document}
\ECFAugie


\begin{frame}[t]
\frametitle{\large Codificación de notas con letras en clave de Sol en Musixtex}
\normalfont
\begin{center}
\begin{minipage}{1\textwidth}\centering
    \vspace*{0.4cm}
    \scalebox{0.67}{
    \begin{music}
    \setclef1{\treble}
    \startextract
    \notes
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} a} 
    \wh{a}
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} b}  
    \wh{b}
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} c}  
    \wh{c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} d} 
    \wh{d}
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} e} 
    \wh{e}
    \zcharnote{-9}{\footnotesize \hspace*{0.04cm} f}  
    \wh{f}
    \zcharnote{-9}{\footnotesize \hspace*{0.04cm} g}  
    \wh{g}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} h}  
    %\endcatcodesmusic
    %\pause
    \onslide<+->\zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,1.8) -- (0,1.8) -- (0,0);    
    \end{tikzpicture}}
    %\catcodesmusic
    \wh{h}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} i} 
    \wh{i} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} j}
    \wh{j}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'd} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} k}
    \wh{k} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} l}
    \wh{l}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'f} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} m}
    \wh{m}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'g} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} n} 
    \wh{n}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} o} 
    \zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,2.4) -- (0,2.4) -- (0,0);    
    \end{tikzpicture}}
    \wh{o}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} p}
    \wh{p} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} q}
    \wh{q}  
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''d} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} r}
    \wh{r} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} s}
    \wh{s} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''f} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} t}
    \wh{t} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''g} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} u}
    \wh{u} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} v}
    \zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,2.8) -- (0,2.8) -- (0,0);    
    \end{tikzpicture}}
    \wh{v}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} w}
    \wh{w}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} x}
    \wh{x}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''d} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} y}
    \wh{y}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} z}
    \wh{z}
    \enotes
    \endextract
    \end{music}}    
\end{minipage}
\end{center}

\end{frame}

\end{document}

当前的

注意,需要覆盖红色矩形才能在 Beamer 框架中进行解释。

答案1

TikZ 命令类似,\draw可以感知叠加。您可以使用它来指定在框架中的哪些幻灯片上应该显示红色框:

\documentclass[aspectratio=169]{beamer}
\usepackage{musixtex}


\usepackage[T1]{fontenc}
\usepackage{emerald}%Fuente tipo mano para pizarra en Beamer
\usepackage[spanish]{babel}
%Paquetes para Beamer
\usepackage{calc}
\usepackage{ifthen}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgffor}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{adjustbox}%Para centrar tablas
\usepackage{xcolor}
\xdefinecolor{gray-undar}{RGB}{52,52,52}
\xdefinecolor{red-undar}{RGB}{179,35,79}
% set text colors for different objects
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{structure}{fg=white}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{alerted text}{fg=white}
\setbeamercolor{example text}{fg=white}
%% set fonts
\setbeamerfont{frametitle}{size=\Huge, series=\ECFAugie}
\setbeamerfont{framesubtitle}{size=\large, series=\ECFAugie}
\setbeamerfont{title}{size=\huge, series=\ECFAugie}
\setbeamerfont{author}{size=\large, series=\ECFAugie}
\setbeamerfont{date}{size=\large, series=\ECFAugie}
\setbeamerfont{institute}{size=\large, series=\ECFAugie}
\setbeamerfont{caption}{series=\ECFAugie}
%% Green Background Colour
\setbeamercolor{background canvas}{bg=green!18!black}
%% Random Dust Trails
\setbeamertemplate{background}{
    \begin{tikzpicture}
        \useasboundingbox (0,0) rectangle (\the\paperwidth, \the\paperheight); 
      \foreach \i in {1,...,30} {
            \pgfmathsetmacro{\x}{random(0,10000)/5000-1}%
            \pgfmathsetmacro{\y}{random(0,10000)/10000-0.1}%
            \pgfmathsetmacro{\r}{random(0,10000)/1000-5}%
            \rotatebox{\r}{
                %\pgftext[at=\pgfpoint{\x\paperwidth}{\y\paperheight}, left, base]{\includegraphics[width=\textwidth]{LOGO_UNDAR_PNG_RGB.png}}
            }
        }; 
    \end{tikzpicture}
}
%% use a small dash ('-') for a bulletpoint list
\setbeamertemplate{itemize item}{\usebeamercolor[fg]{item}\small\ECFAugie{-}}
%% Frametitle
\setbeamertemplate{frametitle}{
    \begin{beamercolorbox}{frametitle}
        \vskip17pt
        \usebeamerfont{frametitle}
        \insertframetitle \\
        \usebeamerfont{framesubtitle}\insertframesubtitle
    \end{beamercolorbox}
}
%% remove navigation symbols
\setbeamertemplate{navigation symbols}{}
%% Date in the Corner
\setbeamertemplate{headline}{
    \rotatebox{30}{
        \ifx\insertdate\empty\else        
            \hspace*{0.25cm}\ECFAugie\insertshortdate\hspace*{0.5cm}
        \fi
    }
    \vspace*{-1cm}
}


\begin{document}
\ECFAugie


\begin{frame}[t]
\frametitle{\large Codificación de notas con letras en clave de Sol en Musixtex}
\normalfont
\begin{center}
\begin{minipage}{1\textwidth}\centering
    \vspace*{0.4cm}
    \scalebox{0.67}{
    \begin{music}
    \setclef1{\treble}
    \startextract
    \notes
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} a} 
    \wh{a}
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} b}  
    \wh{b}
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} c}  
    \wh{c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.05cm} d} 
    \wh{d}
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} e} 
    \wh{e}
    \zcharnote{-9}{\footnotesize \hspace*{0.04cm} f}  
    \wh{f}
    \zcharnote{-9}{\footnotesize \hspace*{0.04cm} g}  
    \wh{g}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} h}  
    %\endcatcodesmusic
    %\pause
    \zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw<2->[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,1.8) -- (0,1.8) -- (0,0);    
    \end{tikzpicture}}
    %\catcodesmusic
    \wh{h}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} i} 
    \wh{i} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} j}
    \wh{j}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'd} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} k}
    \wh{k} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} l}
    \wh{l}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'f} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} m}
    \wh{m}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} 'g} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} n} 
    \wh{n}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} o} 
    \zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw<3->[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,2.4) -- (0,2.4) -- (0,0);    
    \end{tikzpicture}}
    \wh{o}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} p}
    \wh{p} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} q}
    \wh{q}  
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''d} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} r}
    \wh{r} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} s}
    \wh{s} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''f} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} t}
    \wh{t} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} ''g} 
    \zcharnote{-9}{\footnotesize \hspace*{0.09cm} u}
    \wh{u} 
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''a} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} v}
    \zcharnote{-11}{\hspace*{-0.09cm}\begin{tikzpicture}
    \draw<4->[draw=red-undar, very thick, line width=0.4mm] (0,0) -- (0.64,0) -- (0.64,2.8) -- (0,2.8) -- (0,0);    
    \end{tikzpicture}}
    \wh{v}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''b} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} w}
    \wh{w}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''c} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} x}
    \wh{x}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''d} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} y}
    \wh{y}
    \zcharnote{-5}{\footnotesize \hspace*{0.14cm} '''e} 
    \zcharnote{-9}{\footnotesize \hspace*{0.12cm} z}
    \wh{z}
    \enotes
    \endextract
    \end{music}}    
\end{minipage}
\end{center}

\end{frame}

\end{document}

在此处输入图片描述

相关内容