2

Possible Duplicate:
Tikz: purely vertical arrow from nodeA.south to nodeB.north

I have two nodes of different widths. I can align their left edges. I would like to draw a line from (the center of) the bottom of one to the top of the other so that the line is vertical. (In the example, I want the (65)--(75) line to line up with the (75)--(85) line. Is there a way to do this other than by guessing at an angle that achieves vertical?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
  \begin{tikzpicture}
    \node[anchor=west] (65) at (0,0) {$(6,5)=f(5)$};
    \node[above=of 65.west,anchor=west] (75) {$(7,5)$};
    \node[above of=75] (85) {$(8,5)$};
    \draw (65)--(75)--(85);
  \end{tikzpicture}
\end{document}
hoyland
  • 1,796
  • 6
    Is \draw (65.north -| 75)--(75)--(85); what are you looking for? – Qrrbrbirlbel Feb 03 '13 at 00:07
  • Yes! Do you happen to know what bit of the manual it's in? – hoyland Feb 03 '13 at 00:12
  • It is in the section entitled "Coordinates at Intersections". The syntax (a-|b) means "the point located at the same horizontal level than a, and the same vertical than b". – JLDiaz Feb 03 '13 at 00:15
  • 1
    Besides @JLDiaz’ reference to the PGF manual, there are also already answers on TeX.SX, for example Tikz: purely vertical arrow from nodeA.south to nodeB.north. – Qrrbrbirlbel Feb 03 '13 at 00:28
  • @Qrrbrbirlbel, I did google in a number of variations. Unfortunately, I think tex.sx is prone to duplicates or near duplicates because it's hard to describe your question in a way that will be google-able in the future. – hoyland Feb 03 '13 at 00:47
  • @hoyland My comment was not an accusation towards you. It took me a while to find the question, although I remember answering it myself! TeX.SX is a great platform but do not try to gain a great database/archive of knowledge that is searchable and not prone to duplicates. I have already linked another duplicate to it. But these are just my two cents, please carry on. ;) – Qrrbrbirlbel Feb 03 '13 at 01:22

0 Answers0