箭头文字的定位

箭头文字的定位

边缘元素(文本)在右侧放置不正确(查看红色圆圈)。是否可以使它们看起来像镜子(与左侧相比)?

在此处输入图片描述

我的边缘代码:

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Sigma demostration draw}
\author{}
\date{February 2021}

\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows,automata}

\begin{document}
\maketitle
\clearpage

\begin{tikzpicture}
 % flecha
 [->,>=stealth',shorten >=1pt,auto,node distance=1.7cm,font=\scriptsize]
 % estilo circulo
 \tikzstyle{circulo}=[circle,fill=cyan,draw=none,text=black,draw=cyan!40, fill=cyan!10, very thick, minimum size=6mm]
 % estilo cuadrado
 \tikzstyle{cuadrado}=[rectangle,fill=blue,draw=none,text=black,draw=blue!40, fill=blue!10, very thick, minimum size=6mm]

% G1
\node[cuadrado] (g1_1) {$y_m$};
\node[circulo] (g1_2) [left of=g1_1] {$y_m$};
\node[circulo] (g1_3) [right of=g1_1] {$\neg y_m$};
\node[cuadrado] (g1_4) [above left of=g1_2] {$y_m$};
\node[cuadrado] (g1_6) [above right of=g1_3] {$\neg y_m$};
\node[cuadrado] (g1_8) [above right of=g1_2] {$y_m^k$};
\node[cuadrado] (g1_9) [above left of=g1_3] {$\neg y_m^k$};
\node[cuadrado] (g1_10) [above of=g1_8] {$y_m^1$};
\node[cuadrado] (g1_11) [above of=g1_9] {$\neg y_m^1$};

\path   
% G1
    (g1_2) edge [below] node {k+1} (g1_1)
        edge [] node {n-1} (g1_4)
        edge [] node {1} (g1_8)
        edge [bend left] node {1} (g1_10)
    (g1_3) edge [below] node {k+1} (g1_1)
        edge [] node {n-1} (g1_6)
        edge [] node {1} (g1_9)
        edge [bend right] node {1} (g1_11);

\end{tikzpicture}
\end{document}

欢迎提出任何建议!提前致谢。

答案1

在此处输入图片描述

编辑以下代码

\path   
% G1
    (g1_2) edge [below] node {k+1} (g1_1)
        edge [left, pos=0.3] node {n-1} (g1_4)
        edge [left, pos=0.5] node {1} (g1_8)
        edge [bend left, left, pos=0.5] node {1} (g1_10)
    (g1_3) edge [below] node {k+1} (g1_1)
        edge [right, pos=0.3] node {n-1} (g1_6)
        edge [right, pos=0.5] node {1} (g1_9)
        edge [bend right, right, pos=0.5] node {1} (g1_11);

相关内容