按照问题和答案这个问题
我尝试根据自己的需要修改代码。虽然仍然有问题,但我还是成功了。我的代码是:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,positioning,quotes}
\tikzset{
block/.style={
rectangle,
draw,
minimum width=5em,
rounded corners,
minimum height=6ex
},
line/.style={draw, -latex'},
}
\begin{document}
\begin{frame}{Instrumental variables}
\begin{columns}
\begin{column}{.48\linewidth}
\begin{tikzpicture}[node distance=1cm and 2.5cm]
\node [block] (x) {$x$};
\pause[2]
\node [block, right=of x] (y) {$y$};
\pause[3]
\node [block, above=2cm of {$(x)!0.5!(y)$}] (z) {$z$};
\pause[4]
\draw[line] (z) edge ["instrument" '] (x)
(x) edge["instrumented" '] (y);
\end{tikzpicture}
\end{column}
\hfill
\begin{column}{.44\linewidth}
\begin{itemize}
\item $z$ is an instrument for $x$;\medskip
\item $x$ is an instrumented regressor for $y$;\medskip
\item The idea is that:\medskip
\begin{itemize}
\item $E\left( x|\varepsilon \right) \neq 0$\medskip
\item $E\left( z|\varepsilon \right) =0$\medskip
\item $E\left( z|y \right) = 0$\medskip
\end{itemize}
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\end{document}
我喜欢按顺序显示图表。只有在显示完整图片后,我才想在 RHS 上显示文本。我尝试写\pause[5]
在第二列开始之前写入,但它不起作用。
有人能帮助我吗?
提前致谢
答案1
像这样吗?
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,positioning,quotes}
\tikzset{
block/.style={
rectangle,
draw,
minimum width=5em,
rounded corners,
minimum height=6ex
},
line/.style={draw, -latex'},
}
\begin{document}
\begin{frame}{Instrumental variables}
\begin{columns}
\begin{column}{.48\linewidth}
\begin{tikzpicture}[node distance=1cm and 2.5cm]
\node [block] (x) {$x$};
\uncover<2->{
\node [block, right=of x] (y) {$y$};
}
\uncover<3->{
\node [block, above=2cm of {$(x)!0.5!(y)$}] (z) {$z$};
}
\uncover<4->{
\draw[line] (z) edge ["instrument" '] (x)
(x) edge["instrumented" '] (y);
}
\end{tikzpicture}
\end{column}
\hfill
\begin{column}{.44\linewidth}
\uncover<5->{
\begin{itemize}
\item $z$ is an instrument for $x$;\medskip
\item $x$ is an instrumented regressor for $y$;\medskip
\item The idea is that:\medskip
\begin{itemize}
\item $E\left( x|\varepsilon \right) \neq 0$\medskip
\item $E\left( z|\varepsilon \right) =0$\medskip
\item $E\left( z|y \right) = 0$\medskip
\end{itemize}
\end{itemize}
}
\end{column}
\end{columns}
\end{frame}
\end{document}
附录: 关于下面的评论,看看 MWE 的这种重新排列是否可以帮助您设计真正的透明胶片......
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,positioning,quotes}
\tikzset{
block/.style={
rectangle,
draw,
minimum width=17mm,
rounded corners,
minimum height=9mm,
font=\Large
},
line/.style={draw, -latex'},
}
\begin{document}
\begin{frame}{Instrumental variables}
\begin{columns}
\begin{column}{.48\linewidth}
\begin{tikzpicture}[node distance=1cm and 0.5cm]
\uncover<2->{
\node [block] (z) {$z$};
}
\uncover<3->{
\node [block, below left=of z] (x) {$y$};
\draw[line] (z) edge ["instrument" '] (x);
}
\uncover<4->{
\node [block, below right=of z] (y) {$y$};
\draw[line] (x) edge["instrumented" '] (y);
}
\end{tikzpicture}
\end{column}
\hfill
\begin{column}{.48\linewidth}
\uncover<5->{
\begin{itemize}
\item $z$ is an instrument for $x$;\medskip
\item $x$ is an instrumented regressor for $y$;\medskip
\item The idea is that:\medskip
\begin{itemize}
\item $E\left( x|\varepsilon \right) \neq 0$\medskip
\item $E\left( z|\varepsilon \right) =0$\medskip
\item $E\left( z|y \right) = 0$\medskip
\end{itemize}
\end{itemize}
}
\end{column}
\end{columns}
\end{frame}
\end{document}