从右向下到左的弯曲箭头

从右向下到左的弯曲箭头

我正在为我的学生做作业,但我不知道如何制作以下弯曲的箭头。任何帮助都非常感谢!

在此处输入图片描述

我通常按​​照以下说明进行工作:

\newcommand\source[1]{%
    \tikz[remember picture,baseline,inner sep=0pt] {%
        \node [name=source,anchor=base]{$#1$};
    }%
    \setcounter{target}{0}
}
\newcounter{target}
\newcommand\target[1]{%
    \tikz[remember picture,baseline,inner sep=0pt] {%
        \node [name=target-\thetarget,anchor=base]{$#1$};
    }%
    \stepcounter{target}%
}
\newcommand\drawarrows{
    \tikz[remember picture, overlay, bend left=45, -latex] {
        \foreach \i [evaluate=\i as \n using int(\i-1)] in {1,...,\thetarget} {
            \draw (source.north) to (target-\n.north);
        }
    }
}

但我不知道如何改变方向和位置来显示图像。

答案1

我宁愿尝试使用tikzmarkTikZ 库,而不是您的定义:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}
    \[
\frac{x+1}{\tikzmarknode{A}{2}} + \frac{x+1}{\tikzmarknode{B}{3}} \times \tikzmarknode{C}{6}
%
\begin{tikzpicture}[overlay, remember picture,
                    shorten <=1pt, shorten >=1pt, looseness=1.2, 
                    >=latex]
\draw[->] (C.south) to [out=240, in=315] (A.south);
\draw[->] (C.south) to [out=240, in=315] (B.south);
\end{tikzpicture}
\vspace{3ex}
    \]
\end{document}

经过两次编译结果是:

在此处输入图片描述

附则:箭头可以通过我们的包裹arrows.metabending。关于它们,请参阅TikZ & PGF 手册,第 16.3.8 节弯曲和屈曲,第 202 页:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,    % new
                bending,        % new
                tikzmark}
\usepackage{lipsum}

\begin{document}
    \[
\frac{x+1}{\tikzmarknode{A}{2}} + \frac{x+1}{\tikzmarknode{B}{3}} \times \tikzmarknode{C}{6}
%
\begin{tikzpicture}[overlay, remember picture,
                    shorten <=1pt, shorten >=1pt, looseness=1.1,
                    >={Stealth[bend]}  % changed
                    ]
\draw[->] (C.south) to [out=255, in=315] (A.south);
\draw[->] (C.south) to [out=255, in=315] (B.south);
\end{tikzpicture}
\vspace{3ex} % space needed for tikzpicture
    \]
\lipsum[1]
\end{document}

在此处输入图片描述

答案2

另一个解决方案是pstricks

\documentclass{article}
\usepackage{pst-node}

\begin{document}

    \[ \frac{x+1}{\pnode[0.5ex, 0]{2}2} + \frac{x+1}{\pnode[0.5ex, 0]{3}3} \times \pnode[1.2ex, 0]{6}{6}    %
\psset{linewidth=0.5pt, arrows=->, arrowinset=0.12, angleA =-120, nodesep=1.5pt}
\nccurve[angleB=-65]{6}{2} \nccurve[angleB=-60]{6}{3}
    \]

\end{document} 

在此处输入图片描述

相关内容