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 have already defined a node l1:

\node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8]{$l_1$};

And I would like to define another node l2 and position it with regard to l1. I know that below left=...cm of l1 exists, but what if I want to place l2 2cm below and 3cm left with regard to l1?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can specify below left=<vertical distance> and <horizontal distance>. This will specify the distance between the node borders. If instead you want to specify the distance between the node centres, you can set on grid before below left=....

The positioning options are described on pp. 185 of the pgfmanual.

\documentclass[a4paper]{article}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric,positioning}

\begin{document}

\begin{tikzpicture}[
    every node/.style={
        draw,
        ultra thick,
        outer sep=0pt % prevents the thick line from influencing the dimensions of the nodes
    }
]
  \draw [gray!50] (-3,-2) grid (1,3); % to demonstrate placement
  \node (A) [ minimum width=2cm,minimum height=2cm] {A};
  \node [on grid, below left=1cm and 2 cm of A] (B) {B};
  \node [above left=1cm and 1cm of A] {C};
\end{tikzpicture}

\end{document}
share|improve this answer
add comment

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.