答案1
一个简单的方法是使用tikzmark
。你可以看看我的投影仪幻灯片。(有时间我会补充)
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{frame}[t]{Function}
\begin{definition}
A function $f$ is a rule that assigns each element $x$ in a set $X$, called the domain, to \alert{exactly one element},
called $y=f(x)$, in a set $Y$, called the range.
\end{definition}
\begin{align*}
\tikzmarknode{f}{f} :\tikzmarknode{X}{X}&\longrightarrow \tikzmarknode{Y}{Y}\\
x&\longmapsto y=f(x).
\end{align*}
\begin{tikzpicture}[overlay,remember picture]
\draw[magenta,stealth-] (X.north)++(90:.1)--+(90:.3) node[above]{domain};
\draw[magenta,stealth-] (Y.north east)++(90:.1)--+(30:.5) node[right]{range};
\draw[magenta,stealth-] (f.north west)++(90:.1)--+(150:.5) node[left]{function};
\end{tikzpicture}
\end{frame}
\end{document}