以有效的方式绘制箭头

以有效的方式绘制箭头

我正在尝试在乳胶中重现下面的图像,但在绘制箭头时遇到了一些困难。有没有一种简单、省时的方法来实现这一点?

在此处输入图片描述

答案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}

相关内容