1

I'm new to Latex and I've got few problems with tikzpicture.

I would like to shift the inscription further down.

    \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}

enter image description here

  • 1
    Which inscription are you talking about? – grfrazee Feb 24 '17 at 3:50
  • Welcome! Please edit your question to make your code compilable. – cfr Feb 24 '17 at 4:15
  • Untested. Too late to do completions, guessing what people are using. But try: node [yshift=-5pt] {$\beta_1\,\abs{\mathbb{E}_1-u_p}$} or similar. There are better ways, but this should work. (Make 5pt bigger if need be, obviously. – cfr Feb 24 '17 at 4:18
  • Offtopic: use $\cdots$ instead of ... – Sigur Feb 24 '17 at 7:12
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.