테이블의 셀에 셀 색상(또는 강조 효과)이 필요합니다.beamer
클릭 후(즉, 해당 프레임에서 무언가에 대해 이야기할 계획이고 이야기가 끝날 때 셀의 숫자만 강조하겠습니다), , , , 새 명령 사용과 같은 많은 \onslide<>
명령 \only<>
을 \visible<>
시도 \colorbox
했지만 그들 중 누구라도 일했습니다. 마지막으로 몇 가지를 접했습니다.\rowcolor<>{colorname}
코드를 입력하고 인아웃 효과를 사용하여 셀 색상을 지정하기 위해 해당 코드(새 명령 구조를 완전히 알지 못한 채)를 정렬하려고 시도했지만 문제가 있어서 이와 같은 오류가 발생했습니다.
위치가 잘못되었습니다 \noalign
.
무슨 문제가 있나요?
\documentclass[xcolor=table]{beamer}
\rowcolors{1}{gray!30}{gray!10}
\makeatletter
\def\rowcolor{\noalign{\ifnum0=`}\fi\bmr@rowcolor}
\newcommand<>{\bmr@rowcolor}{%
\alt#1%
{\global\let\CT@do@color\CT@@do@color\@ifnextchar[\CT@rowa\CT@rowb}%
{\ifnum0=`{\fi}\@gooble@rowcolor}%
}
\newcommand{\@gooble@rowcolor}[2][]{\@gooble@rowcolor@}
\newcommand{\@gooble@rowcolor@}[1][]{\@gooble@rowcolor@@}
\newcommand{\@gooble@rowcolor@@}[1][]{\ignorespaces}
\makeatother
\makeatletter
\def\cellcolor{\noalign{\ifnum0=`}\fi\bmr@cellcolor}
\newcommand<>{\bmr@cellcolor}{%
\alt#1%
{\global\let\CT@do@color\CT@@do@color\@ifnextchar[\CT@rowa\CT@rowb}%
{\ifnum0=`{\fi}\@gooble@cellcolor}%
}
\newcommand{\@gooble@cellcolor}[2][]{\@gooble@cellcolor@}
\newcommand{\@gooble@cellcolor@}[1][]{\@gooble@cellcolor@@}
\newcommand{\@gooble@cellcolor@@}[1][]{\ignorespaces}
\makeatother
\begin{document}
\begin{frame}{The MWE}%
\only<2>{\rowcolors{1}{blue!30}{blue!10}}
\only<1,3>{\rowcolors{1}{gray!30}{gray!10}}
\begin{center}
\begin{tabular}{cc}
A & B \\
A & B \\
A & B \\
\rowcolor<4>{green} C & D \\
\rowcolor<4,5>{yellow} E & F \\
\rowcolor<4-6>{green} G & H \\
\rowcolor<6>{red} Y & S \\
A & B \
\end{tabular}
\end{center}
\par
\visible<1>{Testing default row colouring ... \\}
\visible<2,3>{Testing change of default colors ...\\}
\visible<4-6>{Testing in-out of custom colors ...\\ (caution: The order of defaults colors can change)\\}
\vfill
\scriptsize{
Based of answer of Martin Scharrer
\url{https://tex.stackexchange.com/questions/18427/why-cant-i-wrap-rowcolor-in-only-beamer}}
\end{frame}
\begin{frame}{Cell Coloring with In-out Effects}
\begin{center}
\begin{tabular}{cc}
A & B \\
C & \cellcolor<3>{green} C \\
D & E \\
F & G \
\end{tabular}
\end{center}
\end{frame}
\end{document}
답변1
\noalign
다음 정의에서 명령 을 삭제합니다 \cellcolor
.
\documentclass[xcolor=table]{beamer}
\rowcolors{1}{gray!30}{gray!10}
\makeatletter
\def\rowcolor{\noalign{\ifnum0=`}\fi\bmr@rowcolor}
\newcommand<>{\bmr@rowcolor}{%
\alt#1%
{\global\let\CT@do@color\CT@@do@color\@ifnextchar[\CT@rowa\CT@rowb}%
{\ifnum0=`{\fi}\@gooble@rowcolor}%
}
\newcommand{\@gooble@rowcolor}[2][]{\@gooble@rowcolor@}
\newcommand{\@gooble@rowcolor@}[1][]{\@gooble@rowcolor@@}
\newcommand{\@gooble@rowcolor@@}[1][]{\ignorespaces}
\makeatother
\makeatletter
\def\cellcolor{{\ifnum0=`}\fi\bmr@cellcolor}
\newcommand<>{\bmr@cellcolor}{%
\alt#1%
{\global\let\CT@do@color\CT@@do@color\@ifnextchar[\CT@rowa\CT@rowb}%
{\ifnum0=`{\fi}\@gooble@cellcolor}%
}
\newcommand{\@gooble@cellcolor}[2][]{\@gooble@cellcolor@}
\newcommand{\@gooble@cellcolor@}[1][]{\@gooble@cellcolor@@}
\newcommand{\@gooble@cellcolor@@}[1][]{\ignorespaces}
\makeatother
\begin{document}
\begin{frame}{The MWE}%
\only<2>{\rowcolors{1}{blue!30}{blue!10}}
\only<1,3>{\rowcolors{1}{gray!30}{gray!10}}
\begin{center}
\begin{tabular}{cc}
A & B \\
A & B \\
A & B \\
\rowcolor<4>{green} C & D \\
\rowcolor<4,5>{yellow} E & F \\
\rowcolor<4-6>{green} G & H \\
\rowcolor<6>{red} Y & S \\
A & B \\
\end{tabular}
\end{center}
\par
\visible<1>{Testing default row colouring ... \\}
\visible<2,3>{Testing change of default colors ...\\}
\visible<4-6>{Testing in-out of custom colors ...\\ (caution: The order of defaults colors can change)\\}
\vfill
\scriptsize{
Based of answer of Martin Scharrer
\url{http://tex.stackexchange.com/questions/18427/why-cant-i-wrap-rowcolor-in-only-beamer}}
\end{frame}
\begin{frame}{Cell Coloring with In-out Effects}
\begin{center}
\begin{tabular}{cc}
A & B \\
C & \cellcolor<3>{green} C \\
D & E \\
F & G \\
\end{tabular}
\end{center}
\end{frame}
\end{document}