也许有人能给我一个解决方案。我想让它如图所示出现在不同的幻灯片中(不重复代码)。
我希望第一张幻灯片中出现没有任何高亮的矩阵,第二张幻灯片中出现蓝色高亮和箭头,第三张幻灯片必须具有如图所示的视图。只要在括号 <> 中写入幻灯片编号,我就可以得到 \tikzmarkin 对象的此序列。但我不知道如何使用箭头做到这一点。
非常感谢你的帮助,Rasa
\documentclass[]{beamer}
\usepackage[customcolors,beamer]{hf-tikz}
\begin{document}
\begin{frame}{}
\[
\mathbf{G}:=\left[\begin{array}{cc}
\tikzmarkin<1,2,3>[set fill color=blue!50!cyan!30,
set border color=blue!40!black]{a}g_{11} & \tikzmarkin<1>[set fill color=green!50!lime!30,
set border color=green!40!black]{b}g_{12}\\ g_{21} \tikzmarkend{a} & g_{22}\tikzmarkend{b} \end{array}\right]=
\left[\begin{array}{cc} \tikzmarkin<1>[set fill color=blue!50!cyan!30,
set border color=blue!40!black]{c}{\mathbf{G}_{1}}
\tikzmarkend{c}
& \tikzmarkin<1>[set fill color=green!50!lime!30,
set border color=green!40!black]{d}\mathbf{G}_{2}\tikzmarkend{d} \end{array}\right].
\tikz[overlay,remember picture]{\draw [blue,-stealth] ([xshift=2.5mm,yshift=0.5mm]a.east) to [out=35,in=145] ([xshift=2.5mm,yshift=0.5mm]c.east);}
\tikz[overlay,remember picture]{\draw [green,-stealth] ([xshift=2.5mm,yshift=0.5mm]b.east) to [out=35,in=145] ([xshift=2.5mm,yshift=0.5mm]d.east);}
\]
\end{frame}
\end{document}
答案1
像这样?
\documentclass[]{beamer}
\usepackage[customcolors,beamer]{hf-tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{frame}{}
\[
\mathbf{G}:=\left[\begin{array}{cc}
\tikzmarkin<1,2>[set fill color=blue!50!cyan!30, set border color=blue!40!black] {a} g_{11} &
\tikzmarkin<1>[set fill color=green!50!lime!30, set border color=green!40!black]{b}g_{12} \\
g_{21} \tikzmarkend{a} & g_{22} \tikzmarkend{b}
\end{array}\right] = \left[\begin{array}{cc}
\tikzmarkin<1>[set fill color=blue!50!cyan!30, set border color=blue!40!black]{c} \mathbf{G}_{1} \tikzmarkend{c}
& \tikzmarkin<1>[set fill color=green!50!lime!30, set border color=green!40!black]{d} \mathbf{G}_{2} \tikzmarkend{d}
\end{array}\right].
\only<1> {\tikz[overlay,remember picture]{\draw [blue,-stealth]
([xshift=2.5mm,yshift=0.5mm]a.east) to [out=35,in=145]([xshift=2.5mm,yshift=0.5mm]c.east);}
\tikz[overlay,remember picture]{\draw [green,-stealth]
([xshift=2.5mm,yshift=0.5mm]b.east) to [out=35,in=145]([xshift=2.5mm,yshift=0.5mm]d.east);}}
\]
\end{frame}
\end{document}