TIKZ \draw 的问题

TIKZ \draw 的问题

我是 Latex 的新手,遇到了一些问题tikzpicture

我想将铭文进一步向下移动。

    \begin{center}
    \begin{tikzpicture}
    \node[state] (1) {$u_{p-1}$};
    \node[draw=red,fill=red,state,right=of 1] (2) {$u_p$};
    \node[state,right=of 2]                    (3) {$u_{p+1}$};
    \node[draw=none,right=of 3]           (4) {...};
    \node[draw=blue, state, right=of 4]            (5) {$\mathbb{E}_1$};


        \draw[
        >=latex,
    %   every node/.style={above,midway},% either
        auto=right,                      % or
        loop above/.style={out=75,in=105,loop},
        every loop,
        ]
        (2)   edge[loop above] node {$1-\beta_1\,\abs{\mathbb{E}_1- u_p}$}   (2)
     edge                 node{$\beta_1\,\abs{\mathbb{E}_1-u_p}$}(3)
     edge             node {$0$} (1);
\end{tikzpicture}
\end{center}

在此处输入图片描述

答案1

\documentclass[tikz]{standalone}
\usepackage{amssymb,mathtools}
\usetikzlibrary{automata,positioning}
\begin{document}
\begin{tikzpicture}
\node[state] (1) {$u_{p-1}$};
\node[draw=red,fill=red,state,right=of 1] (2) {$u_p$};
\node[state,right=of 2]                    (3) {$u_{p+1}$};
\node[draw=none,right=of 3]           (4) {...};
\node[draw=blue, state, right=of 4]            (5) {$\mathbb{E}_1$};

\draw[>=latex,auto=right, loop above/.style={out=75,in=105,loop} ]
 (2)   edge[loop above] node {$1-\beta_1\,|\mathbb{E}_1- u_p|$}   (2)
 edge                 node[below=0.5cm]{$\beta_1\,|\mathbb{E}_1-u_p|$}(3)
 edge             node {$0$} (1);
 \end{tikzpicture}
 \end{document}

相关内容