小编mic*_*ela的帖子

在带有边节点tikz的箭头(不低于/高于)之间插入标签

我试图用箭头绘制图形,我希望箭头的标签位于线条之间(不在上方或下方),如下所示:输出应如何显示: 在此输入图像描述

我正在使用tikz库和边缘节点在两个节点之间绘制箭头.这是箭头上方标签的最小示例:

\documentclass[12pt]{article}
\usepackage[letterpaper, margin=1in, top=2.5cm, bottom=2.5cm]{geometry}
\usepackage{xcolor}
\definecolor{corn}{rgb}{0.98, 0.93, 0.36}
\definecolor{emerald}{rgb}{0.31, 0.78, 0.47}

\usepackage{array}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{float}
\usepackage{subcaption,caption}
\captionsetup{labelsep=period}
\usetikzlibrary{positioning,patterns,arrows,decorations.markings,decorations.pathreplacing,shapes,shapes.misc}
\tikzset{
    %Define standard arrow tip
    >=stealth',
        % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=3pt,
           shorten >=3pt,}
}

\title{ }
\begin{document}
\maketitle

\begin{figure}[h!] 
\centering
\caption{}
\label{paths}
\begin{subfigure}{0.9\textwidth}
\resizebox{.9\textwidth}{!}{
\begin{tikzpicture}[shorten >=2pt,on grid,auto]
\node (A) [draw=black,fill=emerald,double=white,double distance=2pt,shape=rounded rectangle,minimum width=4cm ]{A}; 
\node[right=9cm of A] (B) [draw,fill=corn,shape=rounded rectangle,minimum width=4cm ]{B};
\path[->]
    (A) edge[line width=0.742mm] node[ anchor=center, above, pos=0.5,font=\bfseries] {\Huge +} (B);
    \end{tikzpicture}
} …
Run Code Online (Sandbox Code Playgroud)

latex arrows labels tikz

4
推荐指数
1
解决办法
8061
查看次数

标签 统计

arrows ×1

labels ×1

latex ×1

tikz ×1