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

How to draw a line passing through a point and parallel to another?

\draw (0,0) -- (1,0);
\node (A) at (1,1);

I need \draw (0,1) -- (1,1); parallel to first line.

share|improve this question
up vote 22 down vote accepted

You can use the calc library to calculate the vector between the first two points. By using the + path operator, you can draw a line from a third point in the direction of this vector:


\begin{tikzpicture}[dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1},
  extended line/.style={shorten >=-#1,shorten <=-#1},
  extended line/.default=1cm]

\node [dot=A] at (2,1) {};
\node [dot=B] at (3,2) {};
\node [dot=P] at (2,2) {};

\draw [extended line=0.5cm] (A) -- (B);
\draw [extended line=0.5cm] (P) -- +($(B)-(A)$);


parallel lines with TikZ

share|improve this answer
thanks Jake.... – Regis da Silva May 29 '11 at 21:17

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.