TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can not find a way to effectively identify coordinates of the point, if used in the command let in the draw path. My example:

  \draw[gray] let \p1=(D), \p2=(intersect), \p3=(C) in (\x1,\y2)
           -- +(-\x1,0) node[left, red]{$f(c)$} -- (\x1,\y2) node[above, red]{$F$}
           -- (\x3,\y2) node[right, red]{$E$};

Now I would like to create named coordinate for node with text $F$:

  \coordinate (F) at (\x1,\y2);

but with error. How I could I solve it? Thanks.

share|improve this question
Thank you very much. – jafan Aug 14 '12 at 14:33
up vote 8 down vote accepted

You can just name the node ... (\x1,\y2) node[...] (F) {$F$} and then you have access to the node via (F), so you can do something like:

\draw (F) circle (5pt);

If you really need the x and y coordinates you can use the solution from Extract x, y coordinate of an arbitrary point in TikZ:

enter image description here



% http://tex.stackexchange.com/questions/33703/extract-x-y-coordinate-of-an-arbitrary-point-in-tikz/33706#33706
\newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}%

\coordinate (C) at (0,0);
\coordinate (D) at (2,0);
\coordinate (intersect) at (1,1);

  \draw[gray] let \p1=(D), \p2=(intersect), \p3=(C) in (\x1,\y2)
           -- +(-\x1,0) node[left, red]{$f(c)$} -- (\x1,\y2) node[above, red] (F) {$F$}
           -- (\x3,\y2) node[right, red]  {$E$};

\draw (F) circle (5pt);% can just use the node name

node [below] (F) {$(\XCoord,\YCoord)$}
share|improve this answer
It is better. Thanks. – jafan Aug 14 '12 at 14:38
\ExtractCoordinate{F} ... it is very useful. – jafan Aug 14 '12 at 14:51

You can use the orthogonal intersections to avoid let operation, hence the calc library for such applications.



\coordinate (C) at (2cm,2cm);
\coordinate (D) at (-2cm,-3cm);
\coordinate (intersect) at (1cm,1cm);

\draw[thick,gray] (D |- intersect) coordinate (F) -- 
+([scale=-1]D|-{{(0,0)}}) node[left, red]{$f(c)$} -- 
(F) node[above, red] {$F$}--
(C|-intersect) node[right, red]  {$E$};


enter image description here

share|improve this answer

Thanks to @Jake, the solution of my problem is trivial:

  \draw[gray] let \p1=(D), \p2=(intersect), \p3=(C) in (\x1,\y2)
              -- +(-\x1,0) node[left, red]{$f(c)$} 
              -- (\x1,\y2) node[above, red]{$F$} coordinate (F) at (\x1,\y2) 
              -- (\x3,\y2) node[right, red]{$E$}; 
share|improve this answer

Your Answer


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.