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.

So far I have this, which half gets the job done, but I really wanted a slightly better looking and more descriptive timeline. Really I wanted to be able to write more than one line for each new addition to the timeline.

\documentclass[a4paper, twoside, 11pt]{report}

\usepackage[pdftex]{graphicx}

\newcommand{\foo}{\hspace{-2.3pt}$\bullet$ \hspace{5pt}}

\begin{document}

\scalebox{1}{
\begin{tabular}{r |@{\foo} l}

1947 & AT and T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the 'Dynabook\\
1971 & Busicom 'Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros. Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\

\end{tabular}
}

\end{document}

This code produces:

enter image description here

I really need something that works in the same way the horizontal timeline does when using the chronology package.

Any help would be appreciated!

share|improve this question
1  
Perhaps this is is what you want? –  Andrew Aug 18 at 0:06
1  
See ctan.org/pkg/harnon-cv. This is for a CV but you could use the code for just the timeline part. –  cfr Aug 18 at 2:16

6 Answers 6

With a vertical time-line and multilined cells — and a caption on the left side of the table:

\documentclass[a4paper, twoside, 11pt]{report}

\usepackage[utf8]{inputenc}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{graphicx}
\usepackage[x11names]{xcolor}
\usepackage{colortbl}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

\begin{table}
\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
\caption{Timeline}\vskip -1.5ex
\begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
\toprule
\addlinespace[1.5ex]
1947 & AT and T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the 'Dynabook\\
1971 & Busicom 'Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros. Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
\end{tabular}
\end{table}

\end{document} 

enter image description here

share|improve this answer
2  
That's very nice! :o) –  dawu Aug 18 at 2:38

I have posted posted an answer before which realizes a vertical timeline for another question, but I think this may fit your needs. You can make multi line entries for each timeline entry and multiple entries for each year. Note that it may need some tweaking here and there to fit your needs.

Also note that I'm posting this answer as a community wiki entry because I have posted this same answer before. If you want to give credit for it, please do it at the original question: High level macros and environments based on Tikz.

\documentclass[10pt]{article}

\usepackage[paperwidth=210mm,%
    paperheight=297mm,%
    tmargin=7.5mm,%
    rmargin=7.5mm,%
    bmargin=7.5mm,%
    lmargin=7.5mm,
    vscale=1,%
    hscale=1]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{tikz}

\usetikzlibrary{arrows, calc, decorations.markings, positioning}

\pagestyle{empty}

\makeatletter
\newenvironment{timeline}[6]{%
    % #1 is startyear
    % #2 is tlendyear
    % #3 is yearcolumnwidth
    % #4 is rulecolumnwidth
    % #5 is entrycolumnwidth
    % #6 is timelineheight

    \newcommand{\startyear}{#1}
    \newcommand{\tlendyear}{#2}

    \newcommand{\yearcolumnwidth}{#3}
    \newcommand{\rulecolumnwidth}{#4}
    \newcommand{\entrycolumnwidth}{#5}
    \newcommand{\timelineheight}{#6}

    \newcommand{\templength}{}

    \newcommand{\entrycounter}{0}

    % http://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
    % http://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
    \long\def\ifnodedefined##1##2##3{%
        \@ifundefined{pgf@sh@ns@##1}{##3}{##2}%
    }

    \newcommand{\ifnodeundefined}[2]{%
        \ifnodedefined{##1}{}{##2}
    }

    \newcommand{\drawtimeline}{%
        \draw[timelinerule] (\yearcolumnwidth+5pt, 0pt) -- (\yearcolumnwidth+5pt, -\timelineheight);
        \draw (\yearcolumnwidth+0pt, -10pt) -- (\yearcolumnwidth+10pt, -10pt);
        \draw (\yearcolumnwidth+0pt, -\timelineheight+15pt) -- (\yearcolumnwidth+10pt, -\timelineheight+15pt);

        \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
        \node[year] (year-\startyear) at (\yearcolumnwidth, \templength) {\startyear};

        \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\tlendyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
        \node[year] (year-\tlendyear) at (\yearcolumnwidth, \templength) {\tlendyear};
    }

    \newcommand{\entry}[2]{%
        % #1 is the year
        % #2 is the entry text

        \pgfmathtruncatemacro{\lastentrycount}{\entrycounter}
        \pgfmathtruncatemacro{\entrycounter}{\entrycounter + 1}

        \ifdim \lastentrycount pt > 0 pt%
            \node[entry] (entry-\entrycounter) [below of=entry-\lastentrycount] {##2};
        \else%
            \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
            \node[entry] (entry-\entrycounter) at (\yearcolumnwidth+\rulecolumnwidth+10pt, \templength) {##2};
        \fi

        \ifnodeundefined{year-##1}{%
            \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(##1, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
            \draw (\yearcolumnwidth+2.5pt, \templength) -- (\yearcolumnwidth+7.5pt, \templength);
            \node[year] (year-##1) at (\yearcolumnwidth, \templength) {##1};
        }

        \draw ($(year-##1.east)+(2.5pt, 0pt)$) -- ($(year-##1.east)+(7.5pt, 0pt)$) -- ($(entry-\entrycounter.west)-(5pt,0)$) -- (entry-\entrycounter.west);
    }

    \newcommand{\plainentry}[2]{% plainentry won't print date in the timeline
        % #1 is the year
        % #2 is the entry text

        \pgfmathtruncatemacro{\lastentrycount}{\entrycounter}
        \pgfmathtruncatemacro{\entrycounter}{\entrycounter + 1}

        \ifdim \lastentrycount pt > 0 pt%
            \node[entry] (entry-\entrycounter) [below of=entry-\lastentrycount] {##2};
        \else%
            \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(\startyear, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
            \node[entry] (entry-\entrycounter) at (\yearcolumnwidth+\rulecolumnwidth+10pt, \templength) {##2};
        \fi

        \ifnodeundefined{invisible-year-##1}{%
            \pgfmathsetlengthmacro{\templength}{neg(add(multiply(subtract(##1, \startyear), divide(subtract(\timelineheight, 25), subtract(\tlendyear, \startyear))), 10))}
            \draw (\yearcolumnwidth+2.5pt, \templength) -- (\yearcolumnwidth+7.5pt, \templength);
            \node[year] (invisible-year-##1) at (\yearcolumnwidth, \templength) {};
        }

        \draw ($(invisible-year-##1.east)+(2.5pt, 0pt)$) -- ($(invisible-year-##1.east)+(7.5pt, 0pt)$) -- ($(entry-\entrycounter.west)-(5pt,0)$) -- (entry-\entrycounter.west);
    }

    \begin{tikzpicture}
        \tikzstyle{entry} = [%
            align=left,%
            text width=\entrycolumnwidth,%
            node distance=10mm,%
            anchor=west]
        \tikzstyle{year} = [anchor=east]
        \tikzstyle{timelinerule} = [%
            draw,%
            decoration={markings, mark=at position 1 with {\arrow[scale=1.5]{latex'}}},%
            postaction={decorate},%
            shorten >=0.4pt]

        \drawtimeline
}
{
    \end{tikzpicture}
    \let\startyear\@undefined
    \let\tlendyear\@undefined
    \let\yearcolumnwidth\@undefined
    \let\rulecolumnwidth\@undefined
    \let\entrycolumnwidth\@undefined
    \let\timelineheight\@undefined
    \let\entrycounter\@undefined
    \let\ifnodedefined\@undefined
    \let\ifnodeundefined\@undefined
    \let\drawtimeline\@undefined
    \let\entry\@undefined
}
\makeatother


\begin{document}

\begin{timeline}{1900}{1990}{2cm}{2.5cm}{5cm}{12cm}
\entry{1903}{Wilbur and Orville Wright fly the first powered airplane}
\entry{1914}{Assassination of Franz Ferdinand}
\plainentry{1917}{The October Revolution}
\entry{1928}{Discovery of Penicillin}
\plainentry{1929}{Stock Market Crash of 1929}
\entry{1941}{Attack on Pearl Harbor}
\plainentry{1944}{D-Day}
\entry{1945}{The Bombing of Hiroshima}
\plainentry{1947}{Creation of Israel as a Jewish State}
\entry{1963}{US president John F. Kennedy assassinated in Dallas}
\entry{1969}{The Moon Landing}
\plainentry{1989}{Fall of the Berlin Wall}
\end{timeline}

\bigskip

Text from: A Brief History of LaTeX http://www.xent.com/FoRK-archive/feb98/0307.html

\smallskip

\begin{timeline}{1974}{1985}{2cm}{7cm}{10cm}{0.45\textheight}
\entry{1974}{Donald Knuth stops submitting papers to the AMS because ``the finished
product was just too painful for me to look at''.}
\entry{1977}{Knuth begins his research on typography.}
\entry{1978}{Knuth delivers an AMS Gibbs Lecture entitled Mathematical Typography to the AMS membership at its annual meeting.}
\entry{1979}{Digital Equipment Corporation and the AMS jointly publish Knuth's TeX and METAFONT: New Directions in Typesetting.}
\entry{1980}{The first draft of Spivak's Joy of TeX is announced in TUGboat, vol. 1, no. 1.}
\entry{1982}{Spivak announces AMS-TeX at the joint math meetings.}
\entry{1982}{Version 0 of Spivak's Joy of TeX is released.}
\entry{1982}{Knuth releases dvitype, a model DVI driver.}
\entry{1983}{Lamport writes a LaTeX manual, the earliest known LaTeX manual in existence.}
\entry{1984}{Addison-Wesley publishes Knuth's The TeXbook, destined to become the definitive TeX reference.}
\entry{1984}{Lamport releases version 2.06a of the LaTeX macros.}
\entry{1985}{The Computer Modern (CM) fonts replace the American Modern (AM) fonts in TeX.}
\entry{1985}{Patashnik releases BibTeX version 0.98 for LaTeX 2.08. [``BibTeX 1.0'', TUGboat, vol. 15, no. 3, pp. 269--274, Sept. 1994.}
\end{timeline}

\end{document}
share|improve this answer

Here is another variation using tikz to produce:

enter image description here

As you said that you wanted to be able to have multiple lines for each entry in the timeline I have given them a text width of 60mm and positioned the different entries below each other (and the years to the left of them). Here's the code:

\documentclass[a4paper, twoside, 11pt]{report}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}

\newcommand{\foo}{\hspace{-2.3pt}$\bullet$ \hspace{5pt}}

\begin{document}

\newcounter{year}
\begin{tikzpicture}[yscale=0.5,%
           year/.style={draw=red,text=blue,fill=yellow!20,shape=ellipse,inner sep=2pt},
           description/.style={rectangle,align=center,text width=60mm,anchor=west},
           timeline/.style={->,thick,red!50}]

    \foreach \year/\desc [count=\y] in {%
       1947/AT and T Bell Labs develop the idea of cellular phones,%
       1968/Xerox Palo Alto Research Centre envisage the 'Dynabook,%
       1971/Busicom 'Handy-LE' Calculator,%
       1973/First mobile handset invented by Martin Cooper,%
       1978/Parker Bros. Merlin Computer Toy,%
       1981/Osborne 1 Portable Computer,%
       1982/Grid Compass 1100 Clamshell Laptop,%
       1983/TRS-80 Model 100 Portable PC,%
       1984/Psion Organiser Handheld Computer,%
       1991/Psion Series 3 Minicomputer%
       } { \ifnum\y=1 \node[description](\y){\desc};
           \else\node[description,below=1ex of \z](\y){\desc};
           \fi
           \node[year](y-\y) [left=of \y] {\year};
           \ifnum\y>1\draw[timeline] (y-\z)-- (y-\y);\fi
           \global\let\z=\y% for drawing from last node
       }

\end{tikzpicture}
\end{document}

I have used the counters \y and \z to dynamically draw the edges between the years...I feel like there should be a more efficient tikz-y way of doing this...

share|improve this answer

I haven't looked at the chronology package but can a simple table as the following do?

\documentclass{report}

\usepackage[tableposition = top]{caption}
\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]
\centering
\caption{Timeline.}
\label{tbl:1}
\begin{tabular}{r l}
  \toprule
  1947 & AT\&T Bell Labs develop the idea of cellular phones\\
  1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
  1971 & Busicom `Handy-LE' Calculator\\
  1973 & First mobile handset invented by Martin Cooper\\
  1978 & Parker Bros. Merlin Computer Toy\\
  1981 & Osborne 1 Portable Computer\\
  1982 & Grid Compass 1100 Clamshell Laptop\\
  1983 & TRS-80 Model 100 Portable PC\\
  1984 & Psion Organiser Handheld Computer\\
  1991 & Psion Series 3 Minicomputer\\
  \bottomrule
\end{tabular}
\end{table}
Here we have table~\ref{tbl:1}.

\end{document}

output

If the answer is totally useless, I'll delete it later.

share|improve this answer
1  
Compare your table with the OP's... –  Andrew Aug 18 at 6:47
    
@Andrew Now I see the difference. However, there were no screenshot when I gave my answer and I started editing the code without looking at the output first (which I shouldn't have done, of course). –  Svend Tveskæg Aug 18 at 8:51

Here is another example with TikZ matrices.

The code:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{charter}
\usepackage{environ}
\usepackage{tikz}
\usetikzlibrary{calc,matrix}

% code by Andrew:
% http://tex.stackexchange.com/a/28452/13304
\makeatletter
\let\matamp=&
\catcode`\&=13
\makeatletter
\def&{\iftikz@is@matrix
  \pgfmatrixnextcell
  \else
  \matamp
  \fi}
\makeatother

\newcounter{lines}
\def\endlr{\stepcounter{lines}\\}

\newcounter{vtml}
\setcounter{vtml}{0}

\newif\ifvtimelinetitle
\tikzset{description/.style={
  column 2/.append style={#1}
 },
 timeline color/.store in=\vtmlcolor,
 timeline color=red!80!black,
 timeline color st/.style={fill=\vtmlcolor,draw=\vtmlcolor},
 use timeline header/.is if=vtimelinetitle,
 use timeline header=false,
 timeline title/.store in=\vtimelinetitle,
 timeline title={},
}

\NewEnviron{vtimeline}[1][]{%
\setcounter{lines}{1}%
\stepcounter{vtml}%
\begin{tikzpicture}[column 1/.style={anchor=east},
 column 2/.style={anchor=west},
 text depth=0pt,text height=1ex,
 row sep=1ex,
 column sep=1em,
 #1
]
\matrix(vtimeline\thevtml)[matrix of nodes]{\BODY};
\pgfmathtruncatemacro\endmtx{\thelines-1}
\path[timeline color st] 
($(vtimeline\thevtml-1-1.north east)!0.5!(vtimeline\thevtml-1-2.north west)$)--
($(vtimeline\thevtml-\endmtx-1.south east)!0.5!(vtimeline\thevtml-\endmtx-2.south west)$);
\foreach \x in {1,...,\endmtx}{
 \node[circle,timeline color st, inner sep=0.15pt, draw=white, thick] 
 (vtimeline\thevtml-c-\x) at 
 ($(vtimeline\thevtml-\x-1.east)!0.5!(vtimeline\thevtml-\x-2.west)$){};
 \draw[timeline color st](vtimeline\thevtml-c-\x.west)--++(-3pt,0);
 }
 \ifvtimelinetitle%
  \draw[timeline color st]([yshift=4pt]vtimeline\thevtml.north west)--
  ([yshift=4pt]vtimeline\thevtml.north east);
  \node[anchor=west,yshift=16pt,font=\large]
   at (vtimeline\thevtml-1-1.north west) 
   {\textsc{Timeline \thevtml}: \textit{\vtimelinetitle}};
 \else%
  \relax%
 \fi%
\end{tikzpicture}
}

\begin{document}

\begin{vtimeline}[description={text width=7cm}, 
 row sep=4ex, 
 use timeline header,
 timeline title={The title}]
1947 & AT and T Bell Labs develop the idea of cellular phones\endlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\endlr
1971 & Busicom 'Handy-LE' Calculator\endlr
1973 & First mobile handset invented by Martin Cooper\endlr
1978 & Parker Bros. Merlin Computer Toy\endlr
1981 & Osborne 1 Portable Computer\endlr
1982 & Grid Compass 1100 Clamshell Laptop\endlr
1983 & TRS-80 Model 100 Portable PC\endlr
1984 & Psion Organiser Handheld Computer\endlr
1991 & Psion Series 3 Minicomputer\endlr
\end{vtimeline}

\begin{vtimeline}[timeline color=cyan!80!blue]
1947 & AT and T Bell Labs develop the idea of cellular phones\endlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\endlr
1971 & Busicom 'Handy-LE' Calculator\endlr
1973 & First mobile handset invented by Martin Cooper\endlr
1978 & Parker Bros. Merlin Computer Toy\endlr
1981 & Osborne 1 Portable Computer\endlr
1982 & Grid Compass 1100 Clamshell Laptop\endlr
1983 & TRS-80 Model 100 Portable PC\endlr
1984 & Psion Organiser Handheld Computer\endlr
1991 & Psion Series 3 Minicomputer\endlr
\end{vtimeline}

\end{document}

In the first environment the header is activated. The result is:

enter image description here

In the second environment the header is not set up. In addition, the color is different and no constraints have been put on the description width:

enter image description here

share|improve this answer

An attempt without any package (except for add some color, obviously):

MWE

\documentclass{article}
\usepackage{xcolor}
\newcommand\ytl[2]{
\parbox[b]{8em}{\hfill{\color{cyan}\bfseries\sffamily #1}~$\cdots\cdots$~}\makebox[0pt][c]{$\bullet$}\vrule\quad \parbox[c]{4.5cm}{\vspace{7pt}\color{red!40!black!80}\raggedright\sffamily #2.\\[7pt]}\\[-3pt]}
\begin{document}
\begin{table}
\caption{Timeline of something.}
\centering
\begin{minipage}[t]{.7\linewidth}
\color{gray}
\rule{\linewidth}{1pt}
\ytl{1947}{AT and T Bell Labs develop the idea of cellular phones}
\ytl{1968}{Xerox Palo Alto Research Centre envisage the `Dynabook'}
\ytl{1971}{Busicom 'Handy-LE' Calculator}
\ytl{1973}{First mobile handset invented by Martin Cooper}
\ytl{1978}{Parker Bros. Merlin Computer Toy}
\ytl{1981}{Osborne 1 Portable Computer}
\ytl{1982}{Grid Compass 1100 Clamshell Laptop}
\ytl{1983}{TRS-80 Model 100 Portable PC}
\ytl{1984}{Psion Organiser Handheld Computer}
\ytl{1991}{Psion Series 3 Minicomputer}
\bigskip
\rule{\linewidth}{1pt}%
\end{minipage}%
\end{table}
\end{document}
share|improve this answer

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.