TikZ:\item 处的节点用于

TikZ:\item 处的节点用于

在我的beamer演示中,我想通过将箭头指向其编号来引用某个项目。但是,我不知道如何制作\itemTikZ 节点。否则它工作得很好。

在此处输入图片描述

\documentclass{beamer}

\usetheme{Copenhagen}

\usepackage{mathtools}
\usepackage{tikz}
\tikzstyle{every picture}+=[remember picture]

\setbeamertemplate{enumerate items}[square]

\begin{document}

\begin{frame}\frametitle{Title}

\begin{definition}
Let $z\in X^A(\gamma)$.
Then $a_{N-1}\dotsm a_0$ is nice if
\begin{enumerate}
\item $a_{N-1}\neq0$;

\item
\tikz[baseline]\node[anchor=base](t2){};
$z=a_{N-1}\gamma^{N-1}+\dots+a_1\gamma+a_0$;

\item whenever $b_{N-1}\dotsm b_0$ satistfies
\tikz\node[fill=blue,circle](t1){};
, then $b_{N-2}\neq0$.
\end{enumerate}
\end{definition}

\begin{tikzpicture}[overlay]
\path[blue,thick,->] (t1) edge [out=160 , in=340] (t2);
\end{tikzpicture}

\end{frame}

\end{document}

答案1

以下是使用可选参数的解决方案\item

\item[{\refstepcounter{enumi}%
    \usebeamertemplate{enumerate item}%
    \tikz[baseline]\coordinate(t2);}]%

在此处输入图片描述

\documentclass{beamer}

\usetheme{Copenhagen}

\usepackage{mathtools}
\usepackage{tikz}
\tikzstyle{every picture}+=[remember picture]

\setbeamertemplate{enumerate items}[square]

\begin{document}

\begin{frame}\frametitle{Title}

\begin{definition}
Let $z\in X^A(\gamma)$.
Then $a_{N-1}\dotsm a_0$ is nice if
\begin{enumerate}
\item $a_{N-1}\neq0$;

\item[{\refstepcounter{enumi}\usebeamertemplate{enumerate item}\tikz[baseline]\coordinate(t2);}]%
$z=a_{N-1}\gamma^{N-1}+\dots+a_1\gamma+a_0$;

\item whenever $b_{N-1}\dotsm b_0$ satistfies
\tikz\node[fill=blue,circle](t1){};
, then $b_{N-2}\neq0$.
\end{enumerate}
\end{definition}

\begin{tikzpicture}[overlay]
\path[blue,thick,->] (t1) edge [out=160 , in=340] (t2);
\end{tikzpicture}

\end{frame}

\end{document}

答案2

类似于 Paul Gaborit 的答案,通过修改关卡的 beamer 模板enumi。新模板是square tikzmark。此外,出于测试目的,我手动放置了该remember picture选项。并且每个项目都可以通过节点名称访问

(enummark<item number>)

这是代码...

\documentclass{beamer}
\usetheme{Copenhagen}
\usepackage{mathtools,lmodern}
\usepackage{tikz}


\defbeamertemplate{enumerate item}{square tikzmark}
{
\usebeamerfont*{item projected}%
\usebeamercolor[bg]{item projected}%
\tikz[remember picture,baseline]{
    \node[fill,
              anchor=base,
                    inner sep=0,
                    text width=2.25ex,
                    text height=1.85ex,
                    text depth=.4ex,
                    align=center]
                    (enummark\insertenumlabel) %Node name
                    {\color{fg}\insertenumlabel}; %Node content
        }
}%
[action]
{\setbeamerfont{item projected}{size=\scriptsize}}

\setbeamertemplate{enumerate items}[square tikzmark]


\begin{document}

\begin{frame}\frametitle{Title}

\begin{definition}
Let $z\in X^A(\gamma)$.
Then $a_{N-1}\dotsm a_0$ is nice if
\begin{enumerate}

\item $a_{N-1}\neq0$;

\item $z=a_{N-1}\gamma^{N-1}+\dots+a_1\gamma+a_0$;

\item whenever $b_{N-1}\dotsm b_0$ satistfies \tikz[remember picture]\node[fill=blue,circle](t1){};, then $b_{N-2}\neq0$.
\end{enumerate}
\end{definition}

\begin{tikzpicture}[overlay,remember picture]
\path[blue,thick,->] (t1) edge [out=160 , in=340] (enummark1);
\path[blue,thick,->] (t1) edge [out=160 , in=340] (enummark2);
\path[blue,thick,->] (t1) edge [out=160 , in=340] (enummark3);
\end{tikzpicture}

\end{frame}

\end{document}

在此处输入图片描述

相关内容