节点下方的路径

节点下方的路径

以下是 MWE:

\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm,tikz,twemojis}

\begin{document}
\begin{center}
\begin{tikzpicture}
    % Nodes:
    \node (s) at (-2,0) {$\bullet$};
    \node (a1) at (-1, 2) {\twemoji{art}};
    \node [opacity=0.2] (e) at (2,0) {$\star$};

    % Paths:
    \draw [->] plot coordinates {(s) (e)}; 
    \draw[blue,dashed,->] plot[smooth,tension=0.5, left] coordinates  {(s) (a1) (e)};
    % \node (a1) at (-1, 2) {\twemoji{art}}; ===> Reprint the node.
    
\end{tikzpicture}
\par\end{center}
\end{document}

结果是这样的: 在此处输入图片描述

正如你所看到的多于艺术图标。
有没有办法不用重新打印节点?(或者定义一个新节点)。

谢谢你!

答案1

感谢@SebGlav,解决方案如下:

\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm,tikz,twemojis}
\usetikzlibrary {backgrounds} % <== Add this.

\begin{document}
\begin{center}
\begin{tikzpicture}
    % Nodes:
    \node (s) at (-2,0) {$\bullet$};
    \node (a1) at (-1, 2) {\twemoji{art}};
    \node [opacity=0.2] (e) at (2,0) {$\star$};

    % Paths:
    \scoped [on background layer] { % <== And this line.
        \draw [->] plot coordinates {(s) (e)}; 
        \draw[blue,dashed,->] plot[smooth,tension=0.5, left] coordinates  {(s) (a1) (e)};
    }%
    
\end{tikzpicture}
\par\end{center}
\end{document}

结果: 在此处输入图片描述

相关内容