\documentclass{beamer}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}[sep=huge]
\mathcal{H} \arrow[d,"W_A" swap] \arrow[r,"T"]& \mathcal{H} \arrow[d,"W_A"] \\
\mathbf{R}(A^{1/2}) \arrow[r,"\widetilde{T}" swap] & \mathbf{R}(A^{1/2})
\end{tikzcd}\]
\end{document}
我想在第一次顯示?
的地方$W_A$
,按下回車後$W_A$
就會出現。
答案1
這是左側的解決方案。對於合適的人,可以用同樣的方式完成。
\documentclass{beamer}
\usepackage{tikz-cd}
\begin{document}
\begin{frame}[fragile]{frametitle}{subtitle}%
\[
\begin{tikzcd}%[sep=huge]
\mathcal{H} \only<1>{\arrow[d,"?" swap]}\only<2->{\arrow[d,"W_A" swap]} \arrow[r,"T"]& \mathcal{H}
\arrow[d,"W_A"] \\
\mathbf{R}(A^{1/2}) \arrow[r,"\widetilde{T}"] & \mathbf{R}(A^{1/2})
\end{tikzcd}
\]
\end{frame}
\end{document}
答案2
我會用overlay-beamer-styles
它。
\documentclass{beamer}
\usepackage{tikz-cd}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}[t,fragile]
\frametitle{A commutative diagram}
\[\begin{tikzcd}[sep=huge]
\mathcal{H} \arrow[d,"?"{swap,visible on=<1>},"W_A" {swap,visible on=<2>}]
\arrow[r,"T"]& \mathcal{H} \arrow[d,"?"{visible on=<1>},"W_A" {visible on=<2>}] \\
\mathbf{R}(A^{1/2}) \arrow[r,"\widetilde{T}" swap] & \mathbf{R}(A^{1/2})
\end{tikzcd}\]
\end{frame}
\end{document}
該overlay-beamer-styles
庫有幾個優點,其中之一是它可以避免跳躍。要了解這一點,請考慮以下範例\only
:
\documentclass{beamer}
\usepackage{tikz-cd}
\begin{document}
\begin{frame}[t,fragile]
\frametitle{A commutative diagram}
\[\begin{tikzcd}[sep=huge]
\mathcal{H} \arrow[d,"W_A" swap]
\only<1>{\arrow[r]}
\only<2->{\arrow[r,"T"]}& \mathcal{H}
\arrow[d,"W_A"] \\
\mathbf{R}(A^{1/2}) \arrow[r,"\widetilde{T}" swap] & \mathbf{R}(A^{1/2})
\end{tikzcd}\]
\end{frame}
\end{document}
另一方面,類似的結構overlay-beamer-styles
不跳躍。
\documentclass{beamer}
\usepackage{tikz-cd}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}[t,fragile]
\frametitle{A commutative diagram}
\[\begin{tikzcd}[sep=huge]
\mathcal{H} \arrow[d,"W_A" swap]
\arrow[r,"T" {visible on=<2->}]& \mathcal{H}
\arrow[d,"W_A"] \\
\mathbf{R}(A^{1/2}) \arrow[r,"\widetilde{T}" swap] & \mathbf{R}(A^{1/2})
\end{tikzcd}\]
\end{frame}
\end{document}
確實,在您的範例的特殊情況下,這不是問題,但一般來說是問題。