如何在 TikZ 中网格连接节点并制作弯曲箭头?

如何在 TikZ 中网格连接节点并制作弯曲箭头?

我想在 TikZ 中绘制以下内容:

在此处输入图片描述

但是,我不确定如何绘制所有箭头,并将数学方程式放置在它们显示的位置。我有以下节点(为了简单起见,我使用“鸭子”节点代替节点之间的矩形)。

\documentclass{beamer}
\usepackage{tikz}
    \usetikzlibrary{
        arrows,
        calc,
        chains,
        decorations,
        decorations.text,
        decorations.pathmorphing,
        matrix,
        positioning,
        shapes,
        tikzmark
    }
    \usepackage{tikzpeople}
    
    \begin{document}
    
    \begin{frame}{Test}
    \begin{tikzpicture}[ar/.style={very thick,-latex,cm},nodes={font=\small}]
    \node[alice,minimum size=0.75cm] (a) {$A$};
    \node[duck,minimum size=0.5cm,right of=a] (d1) {};
    \node[devil,minimum size=0.75cm,right of=d1] (e1) {$E_1$};
    \node[duck,minimum size=0.5cm,right of=e1] (d2) {};
    \node[bob,minimum size=0.75cm,right of=d2]  (b) {$B$};
    \node[duck,minimum size=0.5cm,right of=b] (d3) {};
    \node[devil,minimum size=0.75cm,right of=d3] (e2) {$E_2$};
    \node[duck,minimum size=0.5cm,right of=e2] (d4) {};
    \node[charlie,minimum size=0.75cm,right of=d4] (c) {$C$};
    \end{tikzpicture}
    \end{frame}
    
    \end{document}

答案1

类似这样?更新:

    \documentclass{beamer}
\usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
\usepackage{tikz}
\usepackage{tikzpeople}
\usetikzlibrary{
    arrows,
    calc,
    chains,
    decorations,
    decorations.text,
    decorations.pathmorphing,
    matrix,
    positioning,
    shapes,
    tikzmark}
\begin{document}

\begin{frame}{Test}
\begin{tikzpicture}[ar/.style={very thick,-latex,cm},nodes={font=\small}]
\node[alice,minimum size=0.75cm,label={[name=aa]below:$A$}] (a) {};
\node[duck,minimum size=0.5cm,right of=a] (d1) {};
\node[devil,minimum size=0.75cm,right of=d1,label={[name=ee1]below:$E_1$}] (e1) {};
\node[duck,minimum size=0.5cm,right of=e1] (d2) {};
\node[bob,minimum size=0.75cm,right of=d2,label={[name=bb]below:$B$}]  (b) {};
\node[duck,minimum size=0.5cm,right of=b] (d3) {};
\node[devil,minimum size=0.75cm,right of=d3,label={[name=ee2]below:$E_2$}] (e2) {};
\node[duck,minimum size=0.5cm,right of=e2] (d4) {};
\node[charlie,minimum size=0.75cm,right of=d4,label={[name=cc]below:$C$}] (c) {};
    \node[above=2cm of c,coordinate](x){};
        \draw(a)|-(x.center)edge[-Latex]node[pos=.5,left,anchor=east]{formula 4}(c);
            \foreach[var=\up,count=\ii]in{e1,b,e2}
            \draw[-Latex](\up |- x)node[label={above:{text \ii}}]{}--   % [draw] has been removed
            (\up)node[pos=.5,left,anchor=east]{formula \ii};
            \foreach[var=\ar,remember=\ar as \prev (initially a)]in{e1,b,e2,c}
            \draw[-Latex](\prev)to[bend left](\ar);
        \foreach[var=\lab,count=\ii]in{aa,ee1,bb,ee2,cc}
            \node[label={[draw]below:{text \ii}}]at(\lab){};
        \foreach[var=\a, remember=\a as \s (initially aa)]in{ee1,bb,ee2,cc}\draw[Latex-](\s)--(\a);
    \node[text width=3cm,font=\small,above](multline)at(a|-x){This is multiline text with math: % par allowed 

    $\sum_{i=1}^{+\infty}\dfrac{1}{i^2}=\dfrac{\pi^2}{6}$};
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

相关内容