我想在幻灯片上画一个箭头指向另一个位置。这个方法很好用:
\documentclass[t]{beamer}
\usepackage[overlay,absolute]{textpos}
\usepackage{pgf,tikz}
\usetheme{Rochester}
\begin{document}
\begin{frame}
\begin{block}{Foo}
Point\tikz[remember picture] \node[coordinate] (j1) {}; here.
Next line.
\end{block}
\vspace{2cm}
Look\tikz[remember picture] \node[coordinate] (j2) {}; there
\tikz[remember picture,overlay] \draw [->,thick](j2) -- (j1);
\end{frame}
\end{document}
我得到一张包含以下内容的幻灯片:
但为了方便放置,我将其包装block
在一个textblock*
环境中:
\begin{textblock*}{3cm}(1cm,1.5cm)
\begin{block}{Foo}
Point\tikz[remember picture] \node[coordinate] (j1) {}; here.
Next line.
\end{block}
\end{textblock*}
现在我的箭头部分被隐藏了:
显然,textblock*
是画在箭头上方的。我该如何避免这种情况?
答案1
textpos
您可以通过使用不带选项来避免此问题overlay
:
\documentclass[t]{beamer}
\setbeamercolor{background canvas}{bg=}
\usepackage[absolute]{textpos}
\usepackage{pgf,tikz}
\usetheme{Rochester}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{frame}
\begin{textblock*}{3cm}(1cm,1.5cm)
\begin{block}{Foo}
Point\tikzmark{j1} here.
Next line.
\end{block}
\end{textblock*}
\vspace{2cm}
Look\tikzmark{j2} there
\tikz[remember picture,overlay] \draw [->,thick](pic cs:j2) -- (pic cs:j1);
\end{frame}
\end{document}