2

Why the $\times 12$ is not centered on the path ?

enter image description here

\documentclass[border=3pt]{standalone}
\usepackage{tikz}

\begin{document}


\begin{tikzpicture}[bob/.style={outer sep=0pt,text width=2.5em,align=center,draw}]

\node[bob] (A) {1200} ;
\node[bob,anchor=east] (B) at (A.west) {100} ;

    \draw[>=stealth,->] (B.south)--++(0,-.3) -| (A.south)
        node[pos=.5,fill=white,inner sep=1pt] {\small$\times12$};


\end{tikzpicture}

\end{document}
Tarass
  • 16,912
  • 5
    When the path consists of more than one orthogonal segments. 0.5 points to the first corner. Qrrbrbirlbel has a library for it if you wish to use. See http://tex.stackexchange.com/a/102409/3235 – percusse Sep 17 '14 at 17:58

1 Answers1

5

If you only want to center the node in the horizontal part of the path you can split the path in three segments:

\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}[bob/.style={outer sep=0pt,text width=2.5em,align=center,draw}]

\node[bob] (A) {1200} ;
\node[bob,anchor=east] (B) at (A.west) {100} ;
  \draw[>=stealth,->] (B.south)--++(0,-.3)coordinate(h)
      --node[fill=white,inner sep=1pt] {\small$\times12$}(h-|A.south) 
      --(A.south);
\end{tikzpicture}

\end{document}

enter image description here

esdd
  • 85,675