指向 beamer 中的表格单元格

指向 beamer 中的表格单元格

我在 beamer 中创建了下表。我希望使用箭头指向表格底部的总数。我还希望在箭头尾部有一个标签。表格及其内容显示后,箭头需要出现。

 \begin{document}{beamer}
 \begin{frame}{The number of journeys by bees on 29th October}
   \begin{tabular}{!{\vrule}c!{\vrule}c!{\vrule}c!{\vrule}}
   \textcolor{blue}{Score $(x)$} & \textcolor{magenta}{Frequency $(f)$}  & $f\times x$ \\
   \textcolor{blue}{$0$} & \textcolor{magenta}{$100$}& $0 \times 100=0$  \\
   \textcolor{blue}{$1$}& \textcolor{magenta}{$25$} & $1 \times 25=25$ \\
   \textcolor{blue}{$2$}  & \textcolor{magenta}{$75$}  & $150$   \\
   \textcolor{blue}{$3$}  & \textcolor{magenta}{$400$}  & $1200$   \\
   \textcolor{blue}{$4$}  & \textcolor{magenta}{$150$}  & $600$   \\
   \textcolor{blue}{$5$}  & \textcolor{magenta}{$80$}  & $400$  \\
   \rowcolor{orange}  Total  & $830$  & $2375$   \\
   \end{tabular}

  \begin{itemize}[<+-| alert@+>]
   \item How many bees are there in total?
   \item What is the total number of journeys that the bees made?
  \end{itemize}

 \end{frame}
 \end{document}

答案1

我希望我正确地理解了你的问题。(顺便说一句,你的文档没有编译,所以我不得不修复序言。)

\documentclass{beamer}
\usepackage{array,colortbl}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}
 \begin{frame}{The number of journeys by bees on 29th October}
   \begin{tabular}{!{\vrule}c!{\vrule}c!{\vrule}c!{\vrule}}
   \textcolor{blue}{Score $(x)$} & \textcolor{magenta}{Frequency $(f)$}  & $f\times x$ \\
   \textcolor{blue}{$0$} & \textcolor{magenta}{$100$}& $0 \times 100=0$  \\
   \textcolor{blue}{$1$}& \textcolor{magenta}{$25$} & $1 \times 25=25$ \\
   \textcolor{blue}{$2$}  & \textcolor{magenta}{$75$}  & $150$   \\
   \textcolor{blue}{$3$}  & \textcolor{magenta}{$400$}  & $1200$   \\
   \textcolor{blue}{$4$}  & \textcolor{magenta}{$150$}  & $600$   \\
   \textcolor{blue}{$5$}  & \textcolor{magenta}{$80$}  & $400$  \\
   \rowcolor{orange}  Total  & $\tikzmarknode{A}{830}$  & $\tikzmarknode{B}{2375}$   \\
   \end{tabular}
\only<1>{\begin{tikzpicture}[overlay,remember picture]
\draw[latex-,thick] (A.north east) -- ++ (4,2) node[right]{tail};
\draw[latex-,thick] (B.north east) -- ++ (2,1) node[right]{tail};
\end{tikzpicture}}
  \begin{itemize}[<+-| alert@+>]
   \item How many bees are there in total?
   \item What is the total number of journeys that the bees made?
  \end{itemize}

 \end{frame}
 \end{document}

在此处输入图片描述

相关内容