# Is TiKZ the best package for schemes with arrows, lines, etc?

I'd like to make a sort of scheme where historical events are linked through lines that indicate causes of those events, consequences and other information.

I've tried looking around in the PGF examples (great and useful site), and found things like Borrowers and Lenders, but the syntax looks a bit hard to understand. An example of what I want to do (not strictly looking like this, just to get the idea) would be that one, or this.

Click image for bigger version.

(Source)

Is TiKZ the best package to do this? By best I mean: easier to use, with more options, more customizable, etc... Or are there better ways to achieve the same result?

-
The answer is yes for me and I think that Herbert Voss prefers pstricks but this kind of graphs are drawn easily with tikz or pstricks. To get a neat and clean code, you need to know correctly some bases of these packages. – Alain Matthes Apr 25 '12 at 11:02
@Altermundus Thanks... I think that the thing that most scares me is the coordinate system of blocks positioning... – Alenanno Apr 25 '12 at 11:07

You need to analyze correctly the graph. Firstly you can define all the nodes of each column with the same style. You can use positioning to place the nodes. The main column is easy to draw, for the other column, I show you some difficulties like [left= of m1.south west,anchor=north east] and [left= of $(m2.west)!.5!(m3.west)$ ].

\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{%
arrows,positioning,
calc
}

\begin{document}
\small
\begin{tikzpicture}
% main column nb 3
\begin{scope}[node distance=1.5em,
every node/.style={align=center,text width=10em,draw,ultra thick}]
\node (m1) {Soc. Anonima\\
Marca Corona\\
1934};
\node (m2) [above= of m1] {MMMMMMMMMMM\\
xxxxxxxxxxxxx\\
1932};
\node (m3) [above= of m2] {MMMMMMMMMMM\\
xxxxxxxxxxxxx\\
1920};
\node (m4) [above= of m3] {MMMMMMMMMMM\\
xxxxxxxxxxxxx\\
1910};
\node (m5) [above=4.5em of m4] {MMMMMMMMMMM\\
xxxxxxxxxxxxx\\
1869};

\end{scope}

% main column nb 2
\begin{scope}[node distance=.75em,every node/.style={align=center,text width=10em,draw}]

\node (l1) [left= of m1.south west,anchor=north east] {SAIME\\
\ \\
1932};
\node (l2) [left= of $(m2.west)!.5!(m3.west)$ ] {LLLLLLLLLL\\
xxxxxxxxxxxxx\\
1926};
\node (l3) [left= of m4] {LLLLLLLLLL\\
xxxxxxxxxxxxx\\
1911};
\node (l4) [left= of m5] {LLLLLLLLLL\\
xxxxxxxxxxxxx\\
1869};
\end{scope}

%edges
\draw[ultra thick] (m1)--(m2)   (m2)--(m3)   (m3)--(m4)    (m4)--(m5) ;
\draw[dashed] (l1) |- (m2);
\coordinate [above=.5em of m4] (line);
\draw[dotted] ($(line) + (-8,0)$) -- ($(line) + (8,0)$);
\end{tikzpicture}
\end{document}


-
What about adding arrows/lines/paths from a box to another one (not necessarily one after another), is that "another story" or I can simply draw a path between two boxes using IDs or something similar? – Alenanno Apr 25 '12 at 13:08
I made an update. there is no problem for the different edges. If you have a problem with a line, you can define some extra nodes with code like this $(m2.west)!.5!(m3.west)$. – Alain Matthes Apr 25 '12 at 13:20
Fantastic! Thanks. I'll try to play with it for a while and let you know as soon as possible. In the meantime, +1 of course! – Alenanno Apr 25 '12 at 13:27
If you have a problem, add a comment ! and I think you will find TikZ a fine tool to draw something like this. Limitations of TikZ are only about power. – Alain Matthes Apr 25 '12 at 13:29
I managed to make an arrow out of the line you made from SAIME to 1932, and one from 1869 (upper right) to SAIME from the external right. :D Some side questions: you named the boxes m1, m2, m3, etc, and l1, l2, but is that arbitrary? I can choose whatever name? Later I'll try to combine this with a timeline I did with TiKZ. :D – Alenanno Apr 25 '12 at 15:47