As Andrew Stacey pointed out beamer
provides an own \newcommand<>
that deals a little better with overlay specification.
It is now possible to use \tikzMe{BCD}<+>
.
As the overlay-specification argument has the delimiters built-in, so changes need to be made to the beameralert
style. I opted for two versions; these styles are equivalent:
beameralert=2
BeamerAlert=<2>
Code
\documentclass[t]{beamer}
\usepackage{tikz}
\tikzset{
invisible/.style={opacity=0,text opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
},
beameralert/.style={alt=<#1>{fill=red!30,rounded corners}{},anchor=base},
BeamerAlert/.style={alt=#1{fill=red!30,rounded corners}{},anchor=base}
}
\newcommand<>{\tikzMe}[1]{% previously: \def\tikzMe<#1>#2{…
\tikz[baseline]\node[BeamerAlert=#2,anchor=base] {#1};
}
\begin{document}
\begin{frame}{One node}
\tikz[baseline]\node[beameralert=2,anchor=base] {ABCD};
\end{frame}
\begin{frame}{Itemizing (Ti\emph{k}Z)}
\begin{itemize}
\item \tikzMe<+>{ABC}
\item \tikzMe{BCD}<+>% (this works thanks to \newcommand<>)
\item \tikzMe<+>{CDE}
\end{itemize}
\end{frame}
\end{document}
Output
Frame 1

Frame 2

Overlay specifications with ,
(e.g. <3,5>
)
With a small modification overlay specifications with a comma do work:
- Grouping the
BeamerAlert
call itself: BeamerAlert={#2}
grouping BeamerAlert
's alt
call:
BeamerAlert/.style={alt={#1{fill=red!30,rounded corners}{}},anchor=base}
Code
\documentclass[t]{beamer}
\usepackage{tikz}
\tikzset{
invisible/.style={opacity=0,text opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
},
beameralert/.style={alt={<#1>{fill=red!30,rounded corners}{}},anchor=base},
BeamerAlert/.style={alt={#1{fill=red!30,rounded corners}{}},anchor=base}
}
\newcommand<>{\tikzMe}[1]{% previously: \def\tikzMe<#1>#2{…
\tikz[baseline]\node[BeamerAlert={#2},anchor=base] {#1};
}
\begin{document}
\begin{frame}{One node}
\tikz[baseline]\node[beameralert=2,anchor=base] {ABCD};
\end{frame}
\begin{frame}{Itemizing (Ti\emph{k}Z)}
\begin{itemize}
\item \tikzMe<+>{ABC}
\item \tikzMe{BCD}<3,5>% (this works thanks to \newcommand<>)
\item \tikzMe<+>{CDE}
\end{itemize}
\end{frame}
\end{document}
From the beamer manual, section 17.6 (Transparency Effects), use \setbeamercovered
to set the default cover behavior, and override it for old items with the again covered
option.
\documentclass{beamer}
\setbeamercovered{invisible}
\setbeamercovered{%
again covered={\opaqueness<1->{15}}}
\begin{document}
\begin{frame}
\begin{itemize}[<+>]
\item Apple
\item Peach
\item Plum
\item Orange
\end{itemize}
\end{frame}
\end{document}

Best Answer