1

This question already has an answer here:

I define a node Q in TikZ:

\node (Q) at (1,1) {};

Now I want to draw a line to the point (2,2) by doing something like (Q) + (1,1). Doing that I got an error. What is the correct way to do that?

marked as duplicate by Henri Menke tikz-pgf Jan 11 at 4:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    \draw (Q)--++(1,1); – Ulrike Fischer Jan 10 at 14:56
  • 2
    In addition, the calc library allows you to do more complex coordinate calculations. – marmot Jan 10 at 14:57
  • @UlrikeFischer Thank you! What do I do in the following case: \node (N) at (1,1)+(0,1) {};? – Samuel Jan 10 at 15:37
  • 3
    You could do \node (N) at (1+0, 1+1) {};. To add coordinates, not their components, look at the calc library, as @marmot mentioned. Add \usetikzlibrary{calc} to the preamble, and then use \node (N) at ($(1,1) + (0,1)$); – Torbjørn T. Jan 10 at 16:36
  • @Samuel \path (1,1) +(0,1) node (N) {A}; – Henri Menke Jan 11 at 4:17

Browse other questions tagged or ask your own question.