答案1
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
$$
\dfrac{\tikzmarknode{42}{42}}
{\tikzmarknode{72}{72}}=
\dfrac{\tikzmarknode{7}{7}}
{\tikzmarknode{12}{12}}
$$
\begin{tikzpicture}[overlay,remember picture]
\draw[-stealth,shorten >=1mm,shorten <=1mm] (42.north)--++(90:.5)-|(7.north) node[above,pos=.25,red,scale=.8]{$:6$};
\draw[-stealth,shorten >=1mm,shorten <=1mm] (72.south)--++(-90:.5)-|(12.south) node[below,pos=.25,red,scale=.8]{$:6$};
\end{tikzpicture}
\end{document}
解释pos=.25
:我们看看操作如何++
影响选项pos
。
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
$$
\dfrac{\tikzmarknode{42}{42}}
{\tikzmarknode{72}{72}}=
\dfrac{\tikzmarknode{7}{7}}
{\tikzmarknode{12}{12}}
$$
\begin{tikzpicture}[overlay,remember picture]
\draw[-stealth,shorten >=1mm,shorten <=1mm] (42.north)--++(90:.5)-|(7.north) node[pos=0,red,scale=.5]{x} node[pos=0,blue,scale=.4,above]{pos=0}
node[pos=.25,red,scale=.5]{x} node[pos=.25,blue,scale=.4,below]{pos=0.25}
node[pos=.5,red,scale=.5]{x} node[pos=.5,blue,scale=.4,above]{pos=0.5}
node[pos=1,red,scale=.5]{x} node[pos=1,blue,scale=.4,right=3mm]{pos=1}
;
\draw[-stealth,shorten >=1mm,shorten <=1mm] (72.south)--++(-90:.5)-|(12.south) node[below,pos=.25,red,scale=.8]{$:6$};
\end{tikzpicture}
\end{document}