I am trying to incrementally reveal one node at a time in a figure while preserving the text alignment across two nodes.
Here is an example:
\documentclass[presentation]{beamer}
\usepackage{tikz}
\usepackage{transparent}
\usepackage{xcolor}
\tikzset{
invisible/.style={opacity=0},
visible on/.style={alt={#1{}{invisible}}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
\newcommand{\x}{{\color{blue}\ensuremath{x}}}
\begin{document}
\begin{frame}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{scope}
\node[visible on=<1>] (b00) at (0, 0) {
{\transparent{0}$3 \cdot ($}
$f(\x)$
{\transparent{0}$) + 5$}
{$=$}
{\transparent{0}$3 \cdot ($}
$g(\x) * h(\x)$
{\transparent{0}$) + 5$}
};
\node[visible on=<2>] (b00) at (0, 0) {
{\transparent{0.5}$3 \cdot ($}
$f(\x)$
{\transparent{0.5}$) + 5$}
{$=$}
{\transparent{0.5}$3 \cdot ($}
$g(\x) * h(\x)$
{\transparent{0.5}$) + 5$}
};
\end{scope}
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
I am trying to get: f(x) = g(x) ∗ h(x) in the first slide and 3·(f(x)) + 5 = 3.(g(x)∗h(x)) + 5 in the second slide while preserving the alignment of f(x) = g(x) ∗ h(x) across both slides.
Is there a clean way to do this in TIKZ/PGF?
\node<1>
and\node<2>
?