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 am a beginner in LaTeX, trying to use it (and now to promote its use...) for industrial documents. I want to provide diagram relating the chronology of introducing LaTeX in an engineering group. I had tried the chronology package, but could not change the distance between ticks from year to months. I have tried to mimic a chronology diagram in the following code. However i find myself unable to nicely link with the points of the x axis to the nodes describing the steps. I have tentatively added stars (with the idea to make them invisible afterwards) in an attempt to locate where vertical lines drawn from the x axis would be angled to meet the nodes, but could not make this work. Any help appreciated as well as tips on how to improve the diagram.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,}
\begin{document}
\begin{figure}[h]
\begin{tikzpicture}[scale=1]
\small \sf 
\tikzset{label/.style={draw=gray, ultra thin, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=.5ex, above = 2em, anchor=west,rotate=45}}
\tikzset{tick/.style={below=3pt}}
\tikzset{thinline/.style={ultra thin}}
\draw (0,0) -- (10,0);
%draw arrow 
\draw (0,0)[->, -latex] -- (13,0);
%draw 
\draw (0,0)[->, -latex] -- (13,0);
%draw vertical lines
\foreach \x in {1.2,2.2,4.2,5.2,6.2,8.2,9.2,10.2} 
               \draw (\x cm,2ex) node (\x) {*};
%draw nodes
\draw (0,0) node(A0) [tick] {0} node(B0)[] {};
\draw (1.2,0) node(A1) [tick] {1} node(B1) [label]  {end of initial investigations};
\draw (2.2,0) node (A2) [tick] {2} node(B2) [label]  {start of \LaTeX{} spare time investigations};
\draw (3.2,0) node[tick] { 3} node [] {};
\draw (4.2,0) node[tick]  {4} node[label]  {installation of \LaTeX{} on one office computer};
\draw (5.2,0) node[tick] {5} node [label] {second \LaTeX{} user};
\draw (6.2,0) node[tick] {6} node [label] {first \LaTeX{} document moved to remote server};
\draw (7.2,0) node[tick] {7} node []  {};
\draw (8.2,0) node[tick]{8} node [label]  {third \LaTeX{} user};
\draw (9.2,0) node[tick]{9} node [label]  {several documents moved on remote server};
\draw (10.2,0) node[tick] {10} node [label] {fourth \LaTeX{} user};
\end{tikzpicture}
\caption{chronology of events (time in months)}
\end{figure}
\end{document}
share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

How about this:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,}
\begin{document}
\begin{figure}[h]
\begin{tikzpicture}[scale=1]
\small \sf 
\tikzset{label/.style={draw=gray, ultra thin, rounded corners=.25ex, fill=gray!20,text width=4cm, text badly centered,  inner sep=.5ex, above = 2em, anchor=west,rotate=45}}
\tikzset{tick/.style={below=3pt}}
\tikzset{thinline/.style={ultra thin}}
\draw (0,0) -- (10,0);
%draw arrow 
\draw (0,0)[->, -latex] -- (13,0);
%draw 
\draw (0,0)[->, -latex] -- (13,0);
%draw vertical lines
%\foreach \x in {1.2,2.2,4.2,5.2,6.2,8.2,9.2,10.2} 
%               \draw (\x cm,2ex) node (\x) {*};
%draw nodes
\draw (0,0) node (A0) [tick] {0} node (B0)[] {};
\draw (1.2,0) node(A1) [tick] {1} node (B1) [label]  {end of initial investigations};
\draw (2.2,0) node (A2) [tick] {2} node (B2) [label]  {start of \LaTeX{} spare time investigations};
\draw (3.2,0) node[tick] (A3) {3} node (B3) [] {};
\draw (4.2,0) node[tick] (A4) {4} node (B4) [label]  {installation of \LaTeX{} on one office computer};
\draw (5.2,0) node[tick] (A5) {5} node (B5) [label] {second \LaTeX{} user};
\draw (6.2,0) node[tick] (A6) {6} node (B6) [label] {first \LaTeX{} document moved to remote server};
\draw (7.2,0) node[tick] (A7) {7} node (B7) []  {};
\draw (8.2,0) node[tick] (A8) {8} node (B8) [label]  {third \LaTeX{} user};
\draw (9.2,0) node[tick] (A9) {9} node (B9) [label]  {several documents moved on remote server};
\draw (10.2,0) node[tick] (A10) {10} node (B10)[label] {fourth \LaTeX{} user};

\foreach \nn in {1,2,4,5,6,8,9,10}
{   \draw[blue] (B\nn.west) -- ++(0,-0.75);
}

\end{tikzpicture}
\caption{chronology of events (time in months)}
\end{figure}
\end{document}

You started naming your nodes (e.g A0, B1...), I just named all of them and used a foreach loop to draw a line stzarting from their west anchor 0.75 units down.

enter image description here

share|improve this answer
    
Yes I had started to name them, hoping this would help, but could not complete the task. –  Yves May 25 '12 at 10:53
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.