带有文本的方框和箭头(tikz)

带有文本的方框和箭头(tikz)

我正在尝试使用 TikZ 来获得两个像这样彼此之间带有箭头的框(包括箭头上方和下方的文本),但我没有任何经验,所以我一直无法做到这一点。

提前感谢您提供的任何解决方案!我一定会尝试一下。

在此处输入图片描述

在此处输入图片描述

答案1

仅限图像...它们在文本中的位置由您决定:)

在此处输入图片描述

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning, quotes}

\begin{document}
    \begin{tikzpicture}[
    node distance=5mm and 30mm,
box/.style = {draw, minimum height=12mm, align=center},
sy+/.style = {yshift= 2mm}, 
sy-/.style = {yshift=-2mm},
every edge quotes/.style = {align=center}
                        ]
\node (n1) [box]             {\textbf{Party A}\\(fixed rate payer)};                        
\node (n2) [box,right=of n1] {\textbf{Party B}\\(fixed rate payer)};
%
\draw[thick,-Triangle]  
    ([sy+] n1.east) to [above,"Nation $\times$ fixed\\ mortality rate"] ([sy+] n2.west);
\draw[thick,-Triangle, dashed]  
    ([sy-] n2.west) -- ([sy-] n1.east);
    \end{tikzpicture}

    \begin{tikzpicture}[
    node distance=5mm and 44mm,
box/.style = {draw, minimum height=12mm, inner xsep=3mm, align=center},
sy+/.style = {yshift= 2mm},
sy-/.style = {yshift=-2mm},
every edge quotes/.style = {align=center},
     font = \sffamily
                        ]
\node (n1) [box]             {Aegon\\(Hedger)};
\node (n2) [box,right=of n1] {Deutche\\Bank};
%
\draw[thick,-Triangle, dashed]
    ([sy+] n2.west) to [above,"Floating payments' linked\\
                              to \textbf{realized} mortality rates"] ([sy+] n1.east);
\draw[very thick,-Triangle]
    ([sy-] n1.east) to[below,"Fixed payments"] ([sy-] n2.west);
    \end{tikzpicture}
\end{document}

相关内容