在我的 beamer 幻灯片中,我喜欢在 itemize 环境的每个项目之间(以及幻灯片的开始和结束处)使用“ \vfill ”,以便幻灯片完全填满,并且空白处均匀分布。
然而,当我使用一些标注时,这似乎被破坏了。
这是一个例子。评论标注会给出我想要的幻灯片(即使出现标注也不会改变)。我不知道我是否足够清楚,但如果需要的话,我很乐意精确说明一些内容。
\documentclass{beamer}
\usepackage{lipsum,tikz}
\usetikzlibrary{patterns}
\usetikzlibrary {shapes.callouts,positioning}
\begin{document}
\begin{frame}
\frametitle{The title}
\begin{itemize}
\item Something: {\footnotesize \tikz[baseline=(a.base),remember picture] \node[above] (a) {[a],}; \hspace{-2mm}\tikz[baseline=(b.base),remember picture] \node[above] (b) {[b],}; \hspace{-2mm}\tikz[baseline=(c.base),remember picture] \node[above] (c) {[c]};}
\begin{itemize}
\vfill
\item \lipsum[1][1]
\end{itemize}
\vfill
\onslide<5->{\item Something else: {\footnotesize \tikz[baseline=(d.base),remember picture] \node[above] (d) {[d]};}
\begin{itemize}
\vfill
\item Again again again
\vfill
\item And again
\end{itemize}}
\vfill
\onslide<7-9>{\item Almost: {\footnotesize \tikz[baseline=(e.base),remember picture] \node (e) {[e],}; \hspace{-3mm} \tikz[baseline=(f.base),remember picture] \node (f) {[f],}; \hspace{-3mm} \tikz[baseline=(g.base),remember picture] \node[above] (g) {[g],}; \hspace{-3mm} \tikz[baseline=(h.base),remember picture] \node[above] (h) {[H]};}
\begin{itemize}
\vfill
\item over
\vfill
\item the end
\end{itemize}}
\vfill
\end{itemize}
\vfill
% Call-outs to be commented, below:
\begin{tikzpicture}[overlay,remember picture]
\draw<2> (a.south) node[align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(a.south)}] at (3,3.5) {\small This is the thing};
\end{tikzpicture}
\begin{tikzpicture}[overlay,remember picture]
\draw<3> (b.south) node[align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(b.south)}, below right= 1.5cm and 2pt of b.east] {\small Another thing here and there and everywhere};
\end{tikzpicture}
\begin{tikzpicture}[overlay,remember picture]
\path<4> (c.south) ++(0,0) node[text width=2cm, align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(c.east)}, right= 1cm of c.east] {\small Still here};
\end{tikzpicture}
\begin{tikzpicture}[overlay,remember picture]
\draw<6> (d.east) node[text width=4cm, align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(d.east)}, right= 1cm of d.east] {\small Again !!};
\end{tikzpicture}
\end{frame}
\end{document}
答案1
问题在于 tikz 图片和未受保护的行尾之间的所有空行。一旦通过注释掉它们来避免它们,您就会得到相同的布局:
\documentclass{beamer}
\usepackage{lipsum,tikz}
\usetikzlibrary{patterns}
\usetikzlibrary {shapes.callouts,positioning}
\begin{document}
\begin{frame}
\frametitle{The title}
\begin{itemize}
\item Something: {\footnotesize \tikz[baseline=(a.base),remember picture] \node[above] (a) {[a],}; \hspace{-2mm}\tikz[baseline=(b.base),remember picture] \node[above] (b) {[b],}; \hspace{-2mm}\tikz[baseline=(c.base),remember picture] \node[above] (c) {[c]};}
\begin{itemize}
\vfill
\item \lipsum[1][1]
\end{itemize}
\vfill
\onslide<5->{\item Something else: {\footnotesize \tikz[baseline=(d.base),remember picture] \node[above] (d) {[d]};}
\begin{itemize}
\vfill
\item Again again again
\vfill
\item And again
\end{itemize}}
\vfill
\onslide<7-9>{\item Almost: {\footnotesize \tikz[baseline=(e.base),remember picture] \node (e) {[e],}; \hspace{-3mm} \tikz[baseline=(f.base),remember picture] \node (f) {[f],}; \hspace{-3mm} \tikz[baseline=(g.base),remember picture] \node[above] (g) {[g],}; \hspace{-3mm} \tikz[baseline=(h.base),remember picture] \node[above] (h) {[H]};}
\begin{itemize}
\vfill
\item over
\vfill
\item the end
\end{itemize}}
\vfill
\end{itemize}
\vfill
%
% Call-outs to be commented, below:
%
\begin{tikzpicture}[overlay,remember picture]
\draw<2> (a.south) node[align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(a.south)}] at (3,3.5) {\small This is the thing};
\end{tikzpicture}%
%
\begin{tikzpicture}[overlay,remember picture]
\draw<3> (b.south) node[align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(b.south)}, below right= 1.5cm and 2pt of b.east] {\small Another thing here and there and everywhere};
\end{tikzpicture}%
%
%
\begin{tikzpicture}[overlay,remember picture]
\path<4> (c.south) ++(0,0) node[text width=2cm, align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(c.east)}, right= 1cm of c.east] {\small Still here};
\end{tikzpicture}%
%
%
\begin{tikzpicture}[overlay,remember picture]
\draw<6> (d.east) node[text width=4cm, align=center,rectangle callout,fill=red!50,opacity=1, callout absolute pointer={(d.east)}, right= 1cm of d.east] {\small Again !!};
\end{tikzpicture}%
%
\end{frame}
\end{document}