投影仪中方程节点的问题

投影仪中方程节点的问题
\documentclass{beamer}

\mode<presentation>
{
  \usetheme{default}      
  \usecolortheme{default} 
  \usefonttheme{default} 
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz, amsmath, physics}

\begin{document}
\tikzstyle{na} = [baseline=-.5ex]
\begin{frame}
  If truncated to the second order, the KM expansion becomes the \alert{Fokker-Planck (\textbf{FP}) equation}
  \begin{equation*}
    \uncover<2->{\alt<3->{\pdv{p_{1|1}}{t}=-\pdv{}{x}\bigg(\tikz[baseline]{
            \node[fill=magenta!20,anchor=base] (u1) {$a_1(x,t)$};}\;p_{1|1}\bigg)+\frac{1}{2}\pdv[2]{}{x}\bigg(\tikz[baseline]{
            \node[fill=blue!20,anchor=base] (u2) {$a_2(x,t)$};}\;p_{1|1}\bigg)}{\pdv{p_{1|1}}{t}=-\pdv{}{x}\bigg(a_1(x,t)\;p_{1|1}\bigg)+\frac{1}{2}\pdv[2]{}{x}\bigg(a_2(x,t)\;p_{1|1}\bigg)}}
  \end{equation*}

  \uncover<4->{
    \begin{itemize}[<+-| alert@+>]
      \item[] {\textcolor{magenta}{drift} coefficient}
            \tikz[na] \node[coordinate] (l1) {};
    \end{itemize}
  
  \begin{flushright}
    \begin{itemize}[<+-| alert@+>]
      \item[] {\alert{diffusion} coefficient}
            \tikz[na] \node[coordinate] (l2) {};
    \end{itemize}
  \end{flushright}

  \begin{tikzpicture}[overlay]
    \path[->] (l1) edge [bend right] (u1);
    \path[->] (l2) edge [bend right] (u2);
  \end{tikzpicture}
}
\end{frame}
\end{document}

本质上,我想将箭头(l1)和连接(l2)到方程的节点(n1)(n2),但它无法识别它们,因为它们超出了范围。我试图修改代码,但情况却变得更糟了……

答案1

  • 如果你想使用其他 tikzpictures 的节点,你应该使用remember picture选项

  • 您不得在未定义节点的覆盖层上绘制箭头。如果您使用\alt\uncover仅定义某些覆盖层上的节点,则不得在其他覆盖层上绘制箭头。

  • 无需多次重复使用和不使用方框的方程式,而是使用overlay-beamer-styles库来定义填充颜色应在哪些覆盖层上可见

  • 我建议你去看看图书馆tikzmarks。这样你就不用重新发明轮子了

  • 你加载的很多包都是不必要的。你应该清理你的前言,只加载演示所需的包。


\documentclass{beamer}

\mode<presentation>
{
%  \usetheme{default}      
%  \usecolortheme{default} 
%  \usefonttheme{default} 
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
%\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz, 
%amsmath, 
physics}

\tikzset{na/.style={baseline=-.5ex}}
\usetikzlibrary{overlay-beamer-styles}

\begin{document}

\begin{frame}[t]
  If truncated to the second order, the KM expansion becomes the \alert{Fokker-Planck (\textbf{FP}) equation}
  \begin{equation*}
    \uncover<2->{\pdv{p_{1|1}}{t}=-\pdv{}{x}\bigg(\tikz[baseline,remember picture]{
            \node[fill=magenta!20,anchor=base,fill on=<3->] (u1) {$a_1(x,t)$};}\;p_{1|1}\bigg)+\frac{1}{2}\pdv[2]{}{x}\bigg(\tikz[baseline,remember picture]{
            \node[fill=blue!20,anchor=base,fill on=<3->] (u2) {$a_2(x,t)$};}\;p_{1|1}\bigg)}
  \end{equation*}

  \uncover<4->{
    \begin{itemize}[<+-| alert@+>]
      \item[] {\textcolor{magenta}{drift} coefficient}
            \tikz[na,remember picture] \node[coordinate] (l1) {};
    \end{itemize}
  
%  \begin{flushright}
    \begin{itemize}[<+-| alert@+>]
      \item[] {\alert{diffusion} coefficient}
            \tikz[na,remember picture] \node[coordinate] (l2) {};
    \end{itemize}
%  \end{flushright}

\begin{onlyenv}<4->
  \begin{tikzpicture}[overlay,remember picture]
    \path[->] (l1) edge [bend right] (u1);
    \path[->] (l2) edge [bend right] (u2);
  \end{tikzpicture}
\end{onlyenv}
}
\end{frame}
\end{document}

在此处输入图片描述

相关内容