字母拼图设置:使用带有 beamer 包的 cwpuzzle 进行比例、颜色和位置设置

字母拼图设置:使用带有 beamer 包的 cwpuzzle 进行比例、颜色和位置设置

需要使用带有 beamer 包的 cwpuzzle 配置字母拼图:比例(设置缩放)、颜色(用其他颜色更改默认的黑白颜色)和位置(稍微向左移动)。基本代码如下:

\documentclass[aspectratio=169]{beamer}
    
\usepackage{musixtex}
\usepackage[unboxed]{cwpuzzle} %Para hacer pupiletras musicales
\usepackage{framed}% for shaded/shaded*
\colorlet{shadecolor}{white}

\usepackage{calc}
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage{emerald}

\usepackage[spanish]{babel}
%\usepackage{polyglossia}
%\setmainlanguage{spanish}

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgffor}

% 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}
\setbeamerfont{date}{size=\large}
\setbeamerfont{institute}{size=\large}
\setbeamerfont{caption}{series=\ECFAugie}

%% Green Background Colour
%\setbeamercolor{background canvas}{bg=green!20!black}
\setbeamercolor{background canvas}{bg=green!11!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}
}

% logo of my university
\titlegraphic{\colorbox{white}{\includegraphics[width=5cm]{LOGO_UNDAR_PNG_RGB}}
}
\title{Taller de Musixtex}
\subtitle{Una introducción para Músicos}
\author{Aland Bravo Vecorena}
\date[02/02/23]{Huánuco, 02 de Febrero del 2023}
\institute{\LARGE Universidad Nacional Daniel Alomía Robles}

\begin{document}

% set handwritten font
\ECFAugie

\begin{frame}[t,fragile]
    \frametitle{Pupiletras sobre \underline{Musixtex}}
    \centering
    %\begin{shaded}
    \begin{columns}[onlytextwidth]
    
    %\hspace*{-0.7cm}
    \begin{column}{.45\textwidth}
    \PuzzleUnitlength=13pt
    %\PuzzleDefineColorCell{R}{Crimson}
    %\PuzzleDefineColorCell{G}{Green!80}        
    \normalfont    
    \setbeamercolor{normal text}{fg=black}
    \usebeamercolor[fg]{normal text}
    \vspace*{-0.7cm}\begin{shaded}
    %\hspace*{-1.7cm}
    \begin{Puzzle}{16}{12}
        |*    |*    |[1]R  |A  |[2]S  |T     |E     |R     |I     |Z     |A    |D    |O    |[3]S |*  |*    |.
        |*    |*    |*     |*  |V     |*     |*     |*     |*     |*     |*    |*    |*    |T    |*  |[4]T |.
        |*    |[5]L |*     |*  |G     |*     |*     |*     |*     |*     |*    |*    |*    |Y    |*  |E    |.
        |[6]B |A    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |X    |.
        |E    |T    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |A    |E    |*     |*  |*     |*     |*     |*     |*     |*     |[7]M |I    |K    |T    |E  |X    |.
        |M    |X    |*     |*  |*     |[8]V  |E     |C     |T     |O     |R    |I    |A    |L    |*  |*    |.
        |E    |M    |*     |*  |*     |*     |*     |*     |*     |[9]X  |E    |L    |A    |T    |E  |X    |.
        |R    |K    |*     |*  |[10]P |E     |R     |L     |*     |[11]L |A    |T    |E    |X    |*  |*    |.
        |*    |R    |[12]T |*  |[13]M |U     |S     |I     |X     |T     |E    |X    |*    |*    |*  |*    |.
        |*    |C    |T     |*  |*     |[14]B |M     |P     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |*    |*    |F     |*  |[15]T |I     |K     |Z     |*     |*     |*    |*    |*    |*    |*  |*    |.
    \end{Puzzle}
    \end{shaded}
    \setbeamercolor{normal text}{fg=white}
    \usebeamercolor[fg]{normal text}
    \ECFAugie
    \end{column}
    \begin{column}{.5\textwidth}
        \scriptsize
    \begin{PuzzleClues}{\textbf{Horizontal}}
        \Clue{4}{RASTERIZADO}{Any mathematical process}
        \Clue{7}{MIKTEX}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{8}{VECTORIAL}{A network of lines used for locating points}
        \Clue{9}{XELATEX}{Any symbol that could represent a number}
        \Clue{10}{PERL}{Graph that displays data using line segments}
        \Clue{11}{LATEX}{A model or drawing based on a ratio}
        \Clue{13}{MUSIXTEX}{Any mathematical process}
        \Clue{14}{BMP}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{15}{TIKZ}{A network of lines used for locating points}
    \end{PuzzleClues}
        
    \begin{PuzzleClues}{\textbf{Vertical}}
        \Clue{1}{STY}{the positions of a single digit in the whole number}
        \Clue{2}{TEX}{A graph that uses bars to display data}
        \Clue{3}{LATEXMKRC}{The use of rounding to determine a reasonable answer}
        \Clue{5}{SVG}{The number found most often}
        \Clue{6}{BEAMER}{The horizontal and vertical number lines used in a graph}
        \Clue{12}{TTF}{The horizontal and vertical number lines used in a graph}
    \end{PuzzleClues}
    \end{column}
    \end{columns}
    %\end{shaded}
\end{frame}

\begin{frame}[t,fragile]
    \frametitle{Pupiletras sobre \underline{Musixtex}}
    \centering
    %\begin{shaded}
    \begin{columns}[onlytextwidth]
    
    %\hspace*{-0.7cm}
    \begin{column}{.45\textwidth}
    \PuzzleUnitlength=13pt
    %\PuzzleDefineColorCell{R}{Crimson}
    %\PuzzleDefineColorCell{G}{Green!80}        
    \normalfont    
    \setbeamercolor{normal text}{fg=black}
    \usebeamercolor[fg]{normal text}
    \vspace*{-0.7cm}\begin{shaded}
    %\hspace*{-1.7cm}
    \PuzzleSolution %Visualiza la solución
    \begin{Puzzle}{16}{12}
        |*    |*    |[1]R  |A  |[2]S  |T     |E     |R     |I     |Z     |A    |D    |O    |[3]S |*  |*    |.
        |*    |*    |*     |*  |V     |*     |*     |*     |*     |*     |*    |*    |*    |T    |*  |[4]T |.
        |*    |[5]L |*     |*  |G     |*     |*     |*     |*     |*     |*    |*    |*    |Y    |*  |E    |.
        |[6]B |A    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |X    |.
        |E    |T    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |A    |E    |*     |*  |*     |*     |*     |*     |*     |*     |[7]M |I    |K    |T    |E  |X    |.
        |M    |X    |*     |*  |*     |[8]V  |E     |C     |T     |O     |R    |I    |A    |L    |*  |*    |.
        |E    |M    |*     |*  |*     |*     |*     |*     |*     |[9]X  |E    |L    |A    |T    |E  |X    |.
        |R    |K    |*     |*  |[10]P |E     |R     |L     |*     |[11]L |A    |T    |E    |X    |*  |*    |.
        |*    |R    |[12]T |*  |[13]M |U     |S     |I     |X     |T     |E    |X    |*    |*    |*  |*    |.
        |*    |C    |T     |*  |*     |[14]B |M     |P     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |*    |*    |F     |*  |[15]T |I     |K     |Z     |*     |*     |*    |*    |*    |*    |*  |*    |.
    \end{Puzzle}
    \end{shaded}
    \setbeamercolor{normal text}{fg=white}
    \usebeamercolor[fg]{normal text}
    \ECFAugie
    \end{column}
    \begin{column}{.5\textwidth}
        \scriptsize
    \begin{PuzzleClues}{\textbf{Horizontal}}
        \Clue{4}{RASTERIZADO}{Any mathematical process}
        \Clue{7}{MIKTEX}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{8}{VECTORIAL}{A network of lines used for locating points}
        \Clue{9}{XELATEX}{Any symbol that could represent a number}
        \Clue{10}{PERL}{Graph that displays data using line segments}
        \Clue{11}{LATEX}{A model or drawing based on a ratio}
        \Clue{13}{MUSIXTEX}{Any mathematical process}
        \Clue{14}{BMP}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{15}{TIKZ}{A network of lines used for locating points}
    \end{PuzzleClues}
        
    \begin{PuzzleClues}{\textbf{Vertical}}
        \Clue{1}{STY}{the positions of a single digit in the whole number}
        \Clue{2}{TEX}{A graph that uses bars to display data}
        \Clue{3}{LATEXMKRC}{The use of rounding to determine a reasonable answer}
        \Clue{5}{SVG}{The number found most often}
        \Clue{6}{BEAMER}{The horizontal and vertical number lines used in a graph}
        \Clue{12}{TTF}{The horizontal and vertical number lines used in a graph}
    \end{PuzzleClues}
    \end{column}
    \end{columns}
    %\end{shaded}
\end{frame}

\end{document} 

当前输出如下: 当前的

答案1

  • 缩放(设置缩放)

正如我上一个回答中所显示的,大小可以通过以下方式控制:\PuzzleUnitlength=...

  • 颜色(将默认的黑白色改为其他颜色)

拼图本身不使用颜色。线条和文本将以周围文本的颜色打印,单元格本身是透明的,因此它们将显示其背后的任何背景

  • 位置(稍微向左移动)

您可以使用nocenter包选项。一旦关闭自动居中,拼图就会保持对齐。


\documentclass[aspectratio=169]{beamer}
    
\usepackage[unboxed,nocenter]{cwpuzzle} %Para hacer pupiletras musicales
\usepackage{framed}% for shaded/shaded*

\usepackage[T1]{fontenc}
\usepackage{emerald}

\usepackage[spanish]{babel}

% 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}
\setbeamerfont{date}{size=\large}
\setbeamerfont{institute}{size=\large}
\setbeamerfont{caption}{series=\ECFAugie}

%% Green Background Colour
%\setbeamercolor{background canvas}{bg=green!20!black}
\setbeamercolor{background canvas}{bg=green!11!black}

%% 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}
}

% logo of my university
\titlegraphic{\colorbox{white}{\includegraphics[width=5cm]{LOGO_UNDAR_PNG_RGB}}
}
\title{Taller de Musixtex}
\subtitle{Una introducción para Músicos}
\author{Aland Bravo Vecorena}
\date[02/02/23]{Huánuco, 02 de Febrero del 2023}
\institute{\LARGE Universidad Nacional Daniel Alomía Robles}

\begin{document}

% set handwritten font
\ECFAugie

\begin{frame}[t,fragile]
  \frametitle{Pupiletras sobre \underline{Musixtex}}
  \begin{columns}[onlytextwidth]
    \begin{column}{.4\textwidth}
    \PuzzleUnitlength=10pt
    \normalfont    
    \setbeamercolor{normal text}{fg=red}
    \usebeamercolor[fg]{normal text}
    \only<2->{\PuzzleSolution}
    \colorlet{shadecolor}{green}
    \vspace*{-\baselineskip}
    \begin{shaded}
    \begin{Puzzle}{16}{12}
        |*    |*    |[1]R  |A  |[2]S  |T     |E     |R     |I     |Z     |A    |D    |O    |[3]S |*  |*    |.
        |*    |*    |*     |*  |V     |*     |*     |*     |*     |*     |*    |*    |*    |T    |*  |[4]T |.
        |*    |[5]L |*     |*  |G     |*     |*     |*     |*     |*     |*    |*    |*    |Y    |*  |E    |.
        |[6]B |A    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |X    |.
        |E    |T    |*     |*  |*     |*     |*     |*     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |A    |E    |*     |*  |*     |*     |*     |*     |*     |*     |[7]M |I    |K    |T    |E  |X    |.
        |M    |X    |*     |*  |*     |[8]V  |E     |C     |T     |O     |R    |I    |A    |L    |*  |*    |.
        |E    |M    |*     |*  |*     |*     |*     |*     |*     |[9]X  |E    |L    |A    |T    |E  |X    |.
        |R    |K    |*     |*  |[10]P |E     |R     |L     |*     |[11]L |A    |T    |E    |X    |*  |*    |.
        |*    |R    |[12]T |*  |[13]M |U     |S     |I     |X     |T     |E    |X    |*    |*    |*  |*    |.
        |*    |C    |T     |*  |*     |[14]B |M     |P     |*     |*     |*    |*    |*    |*    |*  |*    |.
        |*    |*    |F     |*  |[15]T |I     |K     |Z     |*     |*     |*    |*    |*    |*    |*  |*    |.
    \end{Puzzle}
    \end{shaded}
    \end{column}
    \begin{column}{.5\textwidth}
    \scriptsize
    \begin{PuzzleClues}{\textbf{Horizontal}}
        \Clue{4}{RASTERIZADO}{Any mathematical process}
        \Clue{7}{MIKTEX}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{8}{VECTORIAL}{A network of lines used for locating points}
        \Clue{9}{XELATEX}{Any symbol that could represent a number}
        \Clue{10}{PERL}{Graph that displays data using line segments}
        \Clue{11}{LATEX}{A model or drawing based on a ratio}
        \Clue{13}{MUSIXTEX}{Any mathematical process}
        \Clue{14}{BMP}{The lowest value in a set of numbers through the highest value in the set}
        \Clue{15}{TIKZ}{A network of lines used for locating points}
    \end{PuzzleClues}
        
    \begin{PuzzleClues}{\textbf{Vertical}}
        \Clue{1}{STY}{the positions of a single digit in the whole number}
        \Clue{2}{TEX}{A graph that uses bars to display data}
        \Clue{3}{LATEXMKRC}{The use of rounding to determine a reasonable answer}
        \Clue{5}{SVG}{The number found most often}
        \Clue{6}{BEAMER}{The horizontal and vertical number lines used in a graph}
        \Clue{12}{TTF}{The horizontal and vertical number lines used in a graph}
    \end{PuzzleClues}
    \end{column}
  \end{columns}
\end{frame}

\end{document} 

在此处输入图片描述

相关内容