Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to label two curved paths connecting two nodes with labels placed at their centres using the node[midway] option. This is something that should be very simple but I have not been able to come up with something that works. Here is my MWE with my question as two comments:

\documentclass[crop,border=0]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[>=latex]
    \node [draw,rectangle] (Start) {Start};
    \node [draw,rectangle] (Finish) [right=2cm] {Finish};
    \draw [->,out=90,in=90,looseness=0.75] (Start.north) to (Finish.north);
    % I want to label this path using [midway,below] as {forward}
    \draw [->,out=-90,in=-90,looseness=0.75] (Finish.south) to (Start.south);
    % I want to label this path using [midway,above] as {reverse}
\end{tikzpicture}
\end{document}

Can someone please point me in the right direction.

I also appreciate comments to improve code elegance or simplicity.

Thank you.

share|improve this question

1 Answer 1

up vote 12 down vote accepted

You must put the node direct after to

\documentclass[crop,border=0]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture} [>=latex]
    \node [draw,rectangle] (Start) {Start};
    \node [draw,rectangle] (Finish) [right=2cm] {Finish};
    \draw [->,out=90,in=90,looseness=0.75] (Start.north) to node[above]{above}  (Finish.north);
    \draw [->,out=-90,in=-90,looseness=0.75] (Finish.south) to node[below]{below} (Start.south)
      ;
\end{tikzpicture}
\end{document

enter image description here

share|improve this answer
    
Thank you. I did not know that [midway] was not needed and that the syntax was simpler. –  chandra Jan 1 '12 at 17:58
    
I am also a beginner^+ in tikz ;-) But I used this combination some days before –  Marco Daniel Jan 1 '12 at 18:04
    
@chandra: I believe that midway (or pos=0.5) is the default so does not need to be specified. See moving a label along the path for more options for label placement. –  Peter Grill Jan 1 '12 at 18:11
    
@Peter Grill: Thank you for the explanation and link to a very helpful example. –  chandra Jan 1 '12 at 19:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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