How can you create a vertical timeline?
up vote
82
down vote
favorite
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:
I really need something that works in the same way the horizontal timeline does when using the chronology package.
Any help would be appreciated!
moderntimeline
add a comment |
up vote
82
down vote
favorite
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:
I really need something that works in the same way the horizontal timeline does when using the chronology package.
Any help would be appreciated!
moderntimeline
1
Perhaps this is is what you want?
– Andrew
Aug 18 '14 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 '14 at 2:16
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
1
Off-topic: Please writeAT&T
, notAT and T
.
– Mico
Oct 27 '16 at 5:53
add a comment |
up vote
82
down vote
favorite
up vote
82
down vote
favorite
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:
I really need something that works in the same way the horizontal timeline does when using the chronology package.
Any help would be appreciated!
moderntimeline
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:
I really need something that works in the same way the horizontal timeline does when using the chronology package.
Any help would be appreciated!
moderntimeline
moderntimeline
edited Aug 18 '14 at 6:46
Andrew
30.3k34380
30.3k34380
asked Aug 17 '14 at 23:04
Simon JL
511153
511153
1
Perhaps this is is what you want?
– Andrew
Aug 18 '14 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 '14 at 2:16
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
1
Off-topic: Please writeAT&T
, notAT and T
.
– Mico
Oct 27 '16 at 5:53
add a comment |
1
Perhaps this is is what you want?
– Andrew
Aug 18 '14 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 '14 at 2:16
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
1
Off-topic: Please writeAT&T
, notAT and T
.
– Mico
Oct 27 '16 at 5:53
1
1
Perhaps this is is what you want?
– Andrew
Aug 18 '14 at 0:06
Perhaps this is is what you want?
– Andrew
Aug 18 '14 at 0:06
1
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 '14 at 2:16
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 '14 at 2:16
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
1
1
Off-topic: Please write
AT&T
, not AT and T
.– Mico
Oct 27 '16 at 5:53
Off-topic: Please write
AT&T
, not AT and T
.– Mico
Oct 27 '16 at 5:53
add a comment |
7 Answers
7
active
oldest
votes
up vote
67
down vote
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,table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{textbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
begin{document}
begin{table}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
caption{Timeline}vskip -1.5ex
begin{tabular}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}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}
Added (3/12/18)
Here is a code to satisfy the request of smaller bullets, an initial bullet and an arrow on the time-line:
documentclass[a4paper, twoside, 11pt]{report}
usepackage[utf8]{inputenc}
usepackage[TS1,T1]{fontenc}
usepackage{fourier,erewhon}
usepackage{amssymb, amsbsy}
usepackage{array, booktabs, longtable}
usepackage{graphicx}
usepackage[x11names, table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{tinytextbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
newcommand{bfoo}{raisebox{2.1ex}[0pt]{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}tinytextbullet}}}%
newcommand{tfoo}{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}$boldsymbol uparrow $}}%
begin{document}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{font=blue, labelfont=sc, labelsep=quad}
begin{longtable}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}p{5cm}}
caption{Timeline} \[-1.5ex]
toprule
addlinespace[1.5ex]
multicolumn{1}{c!{tfoo}}{}& \[-2.3ex]
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\
multicolumn{1}{c!{bfoo}}{}&
end{longtable}
end{document}
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
@vrbatim: It works like a breeze withlongtable
.
– Bernard
Apr 6 '16 at 19:58
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
|
show 4 more comments
up vote
30
down vote
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}
% https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
% https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
longdefifnodedefined##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}
letstartyear@undefined
lettlendyear@undefined
letyearcolumnwidth@undefined
letrulecolumnwidth@undefined
letentrycolumnwidth@undefined
lettimelineheight@undefined
letentrycounter@undefined
letifnodedefined@undefined
letifnodeundefined@undefined
letdrawtimeline@undefined
letentry@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.45textheight}
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}
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
add a comment |
up vote
30
down vote
An attempt without any package (except for add some color, obviously):
documentclass{article}
usepackage{xcolor}
newcommandytl[2]{
parbox[b]{8em}{hfill{color{cyan}bfseriessffamily #1}~$cdotscdots$~}makebox[0pt][c]{$bullet$}vrulequad parbox[c]{4.5cm}{vspace{7pt}color{red!40!black!80}raggedrightsffamily #2.\[7pt]}\[-3pt]}
begin{document}
begin{table}
caption{Timeline of something.}
centering
begin{minipage}[t]{.7linewidth}
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}
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with atable
float? Very bad idea. Removebegin{table}
andend{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...
– Fran
Oct 17 '16 at 11:03
or usefloat=false
. See tex.stackexchange.com/a/171983/11604
– Fran
Oct 17 '16 at 11:14
add a comment |
up vote
25
down vote
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
letmatamp=&
catcode`&=13
makeatletter
def&{iftikz@is@matrix
pgfmatrixnextcell
else
matamp
fi}
makeatother
newcounter{lines}
defendlr{stepcounter{lines}\}
newcounter{vtml}
setcounter{vtml}{0}
newififvtimelinetitle
newififvtimebottomline
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,
add bottom line/.is if=vtimebottomline,
add bottom line=false,
timeline title/.store in=vtimelinetitle,
timeline title={},
line offset/.store in=lineoffset,
line offset=4pt,
}
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(vtimelinethevtml)[matrix of nodes]{BODY};
pgfmathtruncatemacroendmtx{thelines-1}
path[timeline color st]
($(vtimelinethevtml-1-1.north east)!0.5!(vtimelinethevtml-1-2.north west)$)--
($(vtimelinethevtml-endmtx-1.south east)!0.5!(vtimelinethevtml-endmtx-2.south west)$);
foreach x in {1,...,endmtx}{
node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
(vtimelinethevtml-c-x) at
($(vtimelinethevtml-x-1.east)!0.5!(vtimelinethevtml-x-2.west)$){};
draw[timeline color st](vtimelinethevtml-c-x.west)--++(-3pt,0);
}
ifvtimelinetitle%
draw[timeline color st]([yshift=lineoffset]vtimelinethevtml.north west)--
([yshift=lineoffset]vtimelinethevtml.north east);
node[anchor=west,yshift=16pt,font=large]
at (vtimelinethevtml-1-1.north west)
{textsc{Timeline thevtml}: textit{vtimelinetitle}};
else%
relax%
fi%
ifvtimebottomline%
draw[timeline color st]([yshift=-lineoffset]vtimelinethevtml.south west)--
([yshift=-lineoffset]vtimelinethevtml.south east);
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 phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
begin{vtimeline}[timeline color=cyan!80!blue, add bottom line, line offset=2pt]
1947 & AT and T Bell Labs develop the idea of cellular phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
end{document}
In the first environment the header is activated. The result is:
In the second environment the header is not set up, but a line is added at the bottom of the timeline with a custom offset (default 4pt
). In addition, the color is different and no constraints have been put on the description width:
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
add a comment |
up vote
16
down vote
Here is another variation using tikz to produce:
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%
} { ifnumy=1 node[description](y){desc};
elsenode[description,below=1ex of z](y){desc};
fi
node[year](y-y) [left=of y] {year};
ifnumy>1draw[timeline] (y-z)-- (y-y);fi
globalletz=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...
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
add a comment |
up vote
11
down vote
Here is a modified version of chronology.sty
, chronology-vert.sty
. Note that this is not at all well-tested and is liable to break. In particular, the timeline is not boxed or resized, so the user must ensure that things fit appropriately.
Caveat emptor...
%% Modifications copyright 2015 Clea F. Rees
%% Code from origfile copyright 2011 Levi Wiseman (see below)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Clea F. Rees.
%%
%% This work consists of the file chronology-vert.sty.
%%
%% chronology-vert.sty is a derived work under the terms of the LPPL.
%% The original file, chronology.sty, is supplied with chronology. A
%% copy of chronology including an unmodified copy of chronology.sty
%% is available from
%% http://ctan.org/tex-archive/macros/latex/contrib/chronology.
%%
%% The main modifications made to this file are as follows:
%% - This notice is added.
%% - The file is renamed.
%% - The timeline is created as a vertical, rather than horizontal
%% progression.
%% - The timeline is not boxed or resized. Hence, it is up to the user
%% to ensure that things fit appropriately.
% based on chronology 2010/6/12 v1.0 Horizontal timeline
NeedsTeXFormat{LaTeX2e}%
ProvidesPackage{chronology-vert}[2015/05/02 v1.0 Horizontal timeline]
RequirePackage{calc}
RequirePackage{tikz}
RequirePackage{ifthen}
newcounter{step}newcounter{stepstart}newcounter{stepstop}
newcounter{yearstart}newcounter{yearstop}newcounter{deltayears}
newlength{ystart}newlength{ystop}
newlength{unit}newlength{timelineheight}
makeatletter
newififchronology@star
newenvironment{chronology}{%
@ifstar{chronology@startruechronology@i*}{chronology@starfalsechronology@i*}%
}{%
end{tikzpicture}%
}%
defchronology@i*{%
@ifnextchar[{chronology@ii*}{chronology@ii*[{5}]}%
}%
defchronology@ii*[#1]#2#3#4{%
@ifnextchar[{chronology@iii*[{#1}]{#2}{#3}{#4}}{chronology@iii*[{#1}]{#2}{#3}{#4}[{#4}]}%
}%
defchronology@iii*[#1]#2#3#4[#5]{%
newififflipped%
ifchronology@star%
flippedtrue%
else%
flippedfalse%
fi%
setcounter{step}{#1}%
setcounter{yearstart}{#2}setcounter{yearstop}{#3}%
setcounter{deltayears}{theyearstop-theyearstart}%
setlength{unit}{#5/thedeltayears}%
setlength{timelineheight}{#4}%
pgfmathsetcounter{stepstart}{theyearstart+thestep-mod(theyearstart,thestep)}%
pgfmathsetcounter{stepstop}{theyearstop-mod(theyearstop,thestep)}%
addtocounter{step}{thestepstart}%
begin{tikzpicture}[baseline={(current bounding box.north)}]%
draw [|->] (0,0) -- (0,-thedeltayears*unit-unit);%
foreach y in {1,...,thedeltayears}%
draw[yshift=-y*unit] (-.1unit,0) -- (.1unit,0);%
addtocounter{deltayears}{1}%
foreach y in {thestepstart,thestep,...,thestepstop}{%
pgfmathsetlengthystop{(-y+theyearstart)*unit}%
draw[yshift=ystop] (-.3unit,0) -- (.3unit,0);%
ifflipped%
node at (0,ystop) [left=.2unit] {y};%
else%
node at (0,ystop) [right=.2unit] {y};%
fi%
}%
}%
makeatother
newcommand{event}[3][e]{%
pgfmathsetlengthystop{(#2-theyearstart)*unit}%
ifx #1e%
ifflipped%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,right=.5unit] {#3};%
else%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,left=.5unit] {#3};%
fi%
else%
pgfmathsetlengthystart{(#1-theyearstart)*unit}%
ifflipped%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,right=.5unit] {#3} (.2unit,-ystop);%
else%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,left=.5unit] {#3} (.2unit,-ystop);%
fi%
fi}
newcommand{decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}
endinput
The example file provided with the chronology
package produces the following if chronology-vert
is used instead (and the vertical spacing removed):
Applying this to the original example:
documentclass[tikz,border=5pt]{standalone}
usepackage{chronology-vert}
begin{document}
begin{chronology}*[5]{1940}{1995}{20cm}
event{1947}{AT and T Bell Labs develop the idea of cellular phones}
event{1968}{Xerox Palo Alto Research Centre envisage the 'Dynabook}
event{1971}{Busicom 'Handy-LE' Calculator}
event{1973}{First mobile handset invented by Martin Cooper}
event{1978}{Parker Bros. Merlin Computer Toy}
event{1981}{Osborne 1 Portable Computer}
event{1982}{Grid Compass 1100 Clamshell Laptop}
event{1983}{TRS-80 Model 100 Portable PC}
event{1984}{Psion Organiser Handheld Computer}
event{1991}{Psion Series 3 Minicomputer}
end{chronology}
end{document}
produces:
add a comment |
up vote
9
down vote
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}
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
add a comment |
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
67
down vote
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,table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{textbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
begin{document}
begin{table}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
caption{Timeline}vskip -1.5ex
begin{tabular}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}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}
Added (3/12/18)
Here is a code to satisfy the request of smaller bullets, an initial bullet and an arrow on the time-line:
documentclass[a4paper, twoside, 11pt]{report}
usepackage[utf8]{inputenc}
usepackage[TS1,T1]{fontenc}
usepackage{fourier,erewhon}
usepackage{amssymb, amsbsy}
usepackage{array, booktabs, longtable}
usepackage{graphicx}
usepackage[x11names, table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{tinytextbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
newcommand{bfoo}{raisebox{2.1ex}[0pt]{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}tinytextbullet}}}%
newcommand{tfoo}{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}$boldsymbol uparrow $}}%
begin{document}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{font=blue, labelfont=sc, labelsep=quad}
begin{longtable}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}p{5cm}}
caption{Timeline} \[-1.5ex]
toprule
addlinespace[1.5ex]
multicolumn{1}{c!{tfoo}}{}& \[-2.3ex]
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\
multicolumn{1}{c!{bfoo}}{}&
end{longtable}
end{document}
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
@vrbatim: It works like a breeze withlongtable
.
– Bernard
Apr 6 '16 at 19:58
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
|
show 4 more comments
up vote
67
down vote
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,table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{textbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
begin{document}
begin{table}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
caption{Timeline}vskip -1.5ex
begin{tabular}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}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}
Added (3/12/18)
Here is a code to satisfy the request of smaller bullets, an initial bullet and an arrow on the time-line:
documentclass[a4paper, twoside, 11pt]{report}
usepackage[utf8]{inputenc}
usepackage[TS1,T1]{fontenc}
usepackage{fourier,erewhon}
usepackage{amssymb, amsbsy}
usepackage{array, booktabs, longtable}
usepackage{graphicx}
usepackage[x11names, table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{tinytextbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
newcommand{bfoo}{raisebox{2.1ex}[0pt]{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}tinytextbullet}}}%
newcommand{tfoo}{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}$boldsymbol uparrow $}}%
begin{document}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{font=blue, labelfont=sc, labelsep=quad}
begin{longtable}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}p{5cm}}
caption{Timeline} \[-1.5ex]
toprule
addlinespace[1.5ex]
multicolumn{1}{c!{tfoo}}{}& \[-2.3ex]
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\
multicolumn{1}{c!{bfoo}}{}&
end{longtable}
end{document}
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
@vrbatim: It works like a breeze withlongtable
.
– Bernard
Apr 6 '16 at 19:58
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
|
show 4 more comments
up vote
67
down vote
up vote
67
down vote
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,table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{textbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
begin{document}
begin{table}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
caption{Timeline}vskip -1.5ex
begin{tabular}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}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}
Added (3/12/18)
Here is a code to satisfy the request of smaller bullets, an initial bullet and an arrow on the time-line:
documentclass[a4paper, twoside, 11pt]{report}
usepackage[utf8]{inputenc}
usepackage[TS1,T1]{fontenc}
usepackage{fourier,erewhon}
usepackage{amssymb, amsbsy}
usepackage{array, booktabs, longtable}
usepackage{graphicx}
usepackage[x11names, table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{tinytextbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
newcommand{bfoo}{raisebox{2.1ex}[0pt]{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}tinytextbullet}}}%
newcommand{tfoo}{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}$boldsymbol uparrow $}}%
begin{document}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{font=blue, labelfont=sc, labelsep=quad}
begin{longtable}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}p{5cm}}
caption{Timeline} \[-1.5ex]
toprule
addlinespace[1.5ex]
multicolumn{1}{c!{tfoo}}{}& \[-2.3ex]
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\
multicolumn{1}{c!{bfoo}}{}&
end{longtable}
end{document}
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,table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{textbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
begin{document}
begin{table}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
caption{Timeline}vskip -1.5ex
begin{tabular}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}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}
Added (3/12/18)
Here is a code to satisfy the request of smaller bullets, an initial bullet and an arrow on the time-line:
documentclass[a4paper, twoside, 11pt]{report}
usepackage[utf8]{inputenc}
usepackage[TS1,T1]{fontenc}
usepackage{fourier,erewhon}
usepackage{amssymb, amsbsy}
usepackage{array, booktabs, longtable}
usepackage{graphicx}
usepackage[x11names, table]{xcolor}
usepackage{caption}
DeclareCaptionFont{blue}{color{LightSteelBlue3}}
newcommand{foo}{color{LightSteelBlue3}makebox[0pt]{tinytextbullet}hskip-0.5ptvrule width 1pthspace{labelsep}}
newcommand{bfoo}{raisebox{2.1ex}[0pt]{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}tinytextbullet}}}%
newcommand{tfoo}{makebox[dimexpr2tabcolsep]%
{color{LightSteelBlue3}$boldsymbol uparrow $}}%
begin{document}
renewcommandarraystretch{1.4}arrayrulecolor{LightSteelBlue3}
captionsetup{font=blue, labelfont=sc, labelsep=quad}
begin{longtable}{@{,}r <{hskip 2pt} !{foo} >{raggedrightarraybackslash}p{5cm}}
caption{Timeline} \[-1.5ex]
toprule
addlinespace[1.5ex]
multicolumn{1}{c!{tfoo}}{}& \[-2.3ex]
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\
multicolumn{1}{c!{bfoo}}{}&
end{longtable}
end{document}
edited Dec 3 at 18:37
answered Aug 18 '14 at 2:37
Bernard
164k769192
164k769192
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
@vrbatim: It works like a breeze withlongtable
.
– Bernard
Apr 6 '16 at 19:58
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
|
show 4 more comments
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
@vrbatim: It works like a breeze withlongtable
.
– Bernard
Apr 6 '16 at 19:58
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
4
4
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
That's very nice! :o)
– dawu
Aug 18 '14 at 2:38
2
2
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
I just want to point out the rather obvious point that shoud someone wish to use a similar code within the standalone class, to produce a self-contained timeline (with a view to inserting it into multiple documents, for instance, with includegraphics), one needs to remove the floating {table} environment. I hope this saves the google some work.
– PatrickT
Oct 6 '15 at 12:03
1
1
@vrbatim: It works like a breeze with
longtable
.– Bernard
Apr 6 '16 at 19:58
@vrbatim: It works like a breeze with
longtable
.– Bernard
Apr 6 '16 at 19:58
1
1
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
@Bernard: Can you please share a MWE for longtable?
– cosmicraga
Oct 27 '16 at 5:18
1
1
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
@cosmicraga: It needs not be changed except for the environment (longtable rather than tabular). This requires the longtable package.
– Lucas Gautheron
Nov 3 '16 at 14:29
|
show 4 more comments
up vote
30
down vote
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}
% https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
% https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
longdefifnodedefined##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}
letstartyear@undefined
lettlendyear@undefined
letyearcolumnwidth@undefined
letrulecolumnwidth@undefined
letentrycolumnwidth@undefined
lettimelineheight@undefined
letentrycounter@undefined
letifnodedefined@undefined
letifnodeundefined@undefined
letdrawtimeline@undefined
letentry@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.45textheight}
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}
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
add a comment |
up vote
30
down vote
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}
% https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
% https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
longdefifnodedefined##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}
letstartyear@undefined
lettlendyear@undefined
letyearcolumnwidth@undefined
letrulecolumnwidth@undefined
letentrycolumnwidth@undefined
lettimelineheight@undefined
letentrycounter@undefined
letifnodedefined@undefined
letifnodeundefined@undefined
letdrawtimeline@undefined
letentry@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.45textheight}
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}
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
add a comment |
up vote
30
down vote
up vote
30
down vote
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}
% https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
% https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
longdefifnodedefined##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}
letstartyear@undefined
lettlendyear@undefined
letyearcolumnwidth@undefined
letrulecolumnwidth@undefined
letentrycolumnwidth@undefined
lettimelineheight@undefined
letentrycounter@undefined
letifnodedefined@undefined
letifnodeundefined@undefined
letdrawtimeline@undefined
letentry@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.45textheight}
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}
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}
% https://tex.stackexchange.com/questions/85528/checking-whether-or-not-a-node-has-been-previously-defined
% https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined
longdefifnodedefined##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}
letstartyear@undefined
lettlendyear@undefined
letyearcolumnwidth@undefined
letrulecolumnwidth@undefined
letentrycolumnwidth@undefined
lettimelineheight@undefined
letentrycounter@undefined
letifnodedefined@undefined
letifnodeundefined@undefined
letdrawtimeline@undefined
letentry@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.45textheight}
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}
edited Apr 13 '17 at 12:34
community wiki
2 revs
szantaii
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
add a comment |
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
1
1
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
this is a great bit of code and very useful. However there is an error in it. Try doing the same timeline twice in a row (use your first example) and you will see that the second time around the year labels (except the first and last) disappear. I think the node names must somehow be retained between runs.
– Aubrey Blumsohn
Feb 5 '15 at 15:12
1
1
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
Can this be extended to add months, as well as years?
– Andrew Watson
Jan 31 '17 at 5:21
add a comment |
up vote
30
down vote
An attempt without any package (except for add some color, obviously):
documentclass{article}
usepackage{xcolor}
newcommandytl[2]{
parbox[b]{8em}{hfill{color{cyan}bfseriessffamily #1}~$cdotscdots$~}makebox[0pt][c]{$bullet$}vrulequad parbox[c]{4.5cm}{vspace{7pt}color{red!40!black!80}raggedrightsffamily #2.\[7pt]}\[-3pt]}
begin{document}
begin{table}
caption{Timeline of something.}
centering
begin{minipage}[t]{.7linewidth}
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}
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with atable
float? Very bad idea. Removebegin{table}
andend{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...
– Fran
Oct 17 '16 at 11:03
or usefloat=false
. See tex.stackexchange.com/a/171983/11604
– Fran
Oct 17 '16 at 11:14
add a comment |
up vote
30
down vote
An attempt without any package (except for add some color, obviously):
documentclass{article}
usepackage{xcolor}
newcommandytl[2]{
parbox[b]{8em}{hfill{color{cyan}bfseriessffamily #1}~$cdotscdots$~}makebox[0pt][c]{$bullet$}vrulequad parbox[c]{4.5cm}{vspace{7pt}color{red!40!black!80}raggedrightsffamily #2.\[7pt]}\[-3pt]}
begin{document}
begin{table}
caption{Timeline of something.}
centering
begin{minipage}[t]{.7linewidth}
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}
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with atable
float? Very bad idea. Removebegin{table}
andend{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...
– Fran
Oct 17 '16 at 11:03
or usefloat=false
. See tex.stackexchange.com/a/171983/11604
– Fran
Oct 17 '16 at 11:14
add a comment |
up vote
30
down vote
up vote
30
down vote
An attempt without any package (except for add some color, obviously):
documentclass{article}
usepackage{xcolor}
newcommandytl[2]{
parbox[b]{8em}{hfill{color{cyan}bfseriessffamily #1}~$cdotscdots$~}makebox[0pt][c]{$bullet$}vrulequad parbox[c]{4.5cm}{vspace{7pt}color{red!40!black!80}raggedrightsffamily #2.\[7pt]}\[-3pt]}
begin{document}
begin{table}
caption{Timeline of something.}
centering
begin{minipage}[t]{.7linewidth}
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}
An attempt without any package (except for add some color, obviously):
documentclass{article}
usepackage{xcolor}
newcommandytl[2]{
parbox[b]{8em}{hfill{color{cyan}bfseriessffamily #1}~$cdotscdots$~}makebox[0pt][c]{$bullet$}vrulequad parbox[c]{4.5cm}{vspace{7pt}color{red!40!black!80}raggedrightsffamily #2.\[7pt]}\[-3pt]}
begin{document}
begin{table}
caption{Timeline of something.}
centering
begin{minipage}[t]{.7linewidth}
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}
answered Aug 28 '14 at 14:52
Fran
50.4k6111174
50.4k6111174
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with atable
float? Very bad idea. Removebegin{table}
andend{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...
– Fran
Oct 17 '16 at 11:03
or usefloat=false
. See tex.stackexchange.com/a/171983/11604
– Fran
Oct 17 '16 at 11:14
add a comment |
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with atable
float? Very bad idea. Removebegin{table}
andend{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...
– Fran
Oct 17 '16 at 11:03
or usefloat=false
. See tex.stackexchange.com/a/171983/11604
– Fran
Oct 17 '16 at 11:14
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
when attempt compile "documentclass[border=5pt]{standalone}" give error... Help :(
– Luis Rivera
Oct 16 '16 at 18:27
@LuisRivera ... A standalone class with a
table
float? Very bad idea. Remove begin{table}
and end{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...– Fran
Oct 17 '16 at 11:03
@LuisRivera ... A standalone class with a
table
float? Very bad idea. Remove begin{table}
and end{table}
. But anyway, why a standalone? This is not a tikz image that take time to compile ...– Fran
Oct 17 '16 at 11:03
or use
float=false
. See tex.stackexchange.com/a/171983/11604– Fran
Oct 17 '16 at 11:14
or use
float=false
. See tex.stackexchange.com/a/171983/11604– Fran
Oct 17 '16 at 11:14
add a comment |
up vote
25
down vote
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
letmatamp=&
catcode`&=13
makeatletter
def&{iftikz@is@matrix
pgfmatrixnextcell
else
matamp
fi}
makeatother
newcounter{lines}
defendlr{stepcounter{lines}\}
newcounter{vtml}
setcounter{vtml}{0}
newififvtimelinetitle
newififvtimebottomline
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,
add bottom line/.is if=vtimebottomline,
add bottom line=false,
timeline title/.store in=vtimelinetitle,
timeline title={},
line offset/.store in=lineoffset,
line offset=4pt,
}
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(vtimelinethevtml)[matrix of nodes]{BODY};
pgfmathtruncatemacroendmtx{thelines-1}
path[timeline color st]
($(vtimelinethevtml-1-1.north east)!0.5!(vtimelinethevtml-1-2.north west)$)--
($(vtimelinethevtml-endmtx-1.south east)!0.5!(vtimelinethevtml-endmtx-2.south west)$);
foreach x in {1,...,endmtx}{
node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
(vtimelinethevtml-c-x) at
($(vtimelinethevtml-x-1.east)!0.5!(vtimelinethevtml-x-2.west)$){};
draw[timeline color st](vtimelinethevtml-c-x.west)--++(-3pt,0);
}
ifvtimelinetitle%
draw[timeline color st]([yshift=lineoffset]vtimelinethevtml.north west)--
([yshift=lineoffset]vtimelinethevtml.north east);
node[anchor=west,yshift=16pt,font=large]
at (vtimelinethevtml-1-1.north west)
{textsc{Timeline thevtml}: textit{vtimelinetitle}};
else%
relax%
fi%
ifvtimebottomline%
draw[timeline color st]([yshift=-lineoffset]vtimelinethevtml.south west)--
([yshift=-lineoffset]vtimelinethevtml.south east);
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 phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
begin{vtimeline}[timeline color=cyan!80!blue, add bottom line, line offset=2pt]
1947 & AT and T Bell Labs develop the idea of cellular phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
end{document}
In the first environment the header is activated. The result is:
In the second environment the header is not set up, but a line is added at the bottom of the timeline with a custom offset (default 4pt
). In addition, the color is different and no constraints have been put on the description width:
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
add a comment |
up vote
25
down vote
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
letmatamp=&
catcode`&=13
makeatletter
def&{iftikz@is@matrix
pgfmatrixnextcell
else
matamp
fi}
makeatother
newcounter{lines}
defendlr{stepcounter{lines}\}
newcounter{vtml}
setcounter{vtml}{0}
newififvtimelinetitle
newififvtimebottomline
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,
add bottom line/.is if=vtimebottomline,
add bottom line=false,
timeline title/.store in=vtimelinetitle,
timeline title={},
line offset/.store in=lineoffset,
line offset=4pt,
}
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(vtimelinethevtml)[matrix of nodes]{BODY};
pgfmathtruncatemacroendmtx{thelines-1}
path[timeline color st]
($(vtimelinethevtml-1-1.north east)!0.5!(vtimelinethevtml-1-2.north west)$)--
($(vtimelinethevtml-endmtx-1.south east)!0.5!(vtimelinethevtml-endmtx-2.south west)$);
foreach x in {1,...,endmtx}{
node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
(vtimelinethevtml-c-x) at
($(vtimelinethevtml-x-1.east)!0.5!(vtimelinethevtml-x-2.west)$){};
draw[timeline color st](vtimelinethevtml-c-x.west)--++(-3pt,0);
}
ifvtimelinetitle%
draw[timeline color st]([yshift=lineoffset]vtimelinethevtml.north west)--
([yshift=lineoffset]vtimelinethevtml.north east);
node[anchor=west,yshift=16pt,font=large]
at (vtimelinethevtml-1-1.north west)
{textsc{Timeline thevtml}: textit{vtimelinetitle}};
else%
relax%
fi%
ifvtimebottomline%
draw[timeline color st]([yshift=-lineoffset]vtimelinethevtml.south west)--
([yshift=-lineoffset]vtimelinethevtml.south east);
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 phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
begin{vtimeline}[timeline color=cyan!80!blue, add bottom line, line offset=2pt]
1947 & AT and T Bell Labs develop the idea of cellular phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
end{document}
In the first environment the header is activated. The result is:
In the second environment the header is not set up, but a line is added at the bottom of the timeline with a custom offset (default 4pt
). In addition, the color is different and no constraints have been put on the description width:
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
add a comment |
up vote
25
down vote
up vote
25
down vote
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
letmatamp=&
catcode`&=13
makeatletter
def&{iftikz@is@matrix
pgfmatrixnextcell
else
matamp
fi}
makeatother
newcounter{lines}
defendlr{stepcounter{lines}\}
newcounter{vtml}
setcounter{vtml}{0}
newififvtimelinetitle
newififvtimebottomline
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,
add bottom line/.is if=vtimebottomline,
add bottom line=false,
timeline title/.store in=vtimelinetitle,
timeline title={},
line offset/.store in=lineoffset,
line offset=4pt,
}
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(vtimelinethevtml)[matrix of nodes]{BODY};
pgfmathtruncatemacroendmtx{thelines-1}
path[timeline color st]
($(vtimelinethevtml-1-1.north east)!0.5!(vtimelinethevtml-1-2.north west)$)--
($(vtimelinethevtml-endmtx-1.south east)!0.5!(vtimelinethevtml-endmtx-2.south west)$);
foreach x in {1,...,endmtx}{
node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
(vtimelinethevtml-c-x) at
($(vtimelinethevtml-x-1.east)!0.5!(vtimelinethevtml-x-2.west)$){};
draw[timeline color st](vtimelinethevtml-c-x.west)--++(-3pt,0);
}
ifvtimelinetitle%
draw[timeline color st]([yshift=lineoffset]vtimelinethevtml.north west)--
([yshift=lineoffset]vtimelinethevtml.north east);
node[anchor=west,yshift=16pt,font=large]
at (vtimelinethevtml-1-1.north west)
{textsc{Timeline thevtml}: textit{vtimelinetitle}};
else%
relax%
fi%
ifvtimebottomline%
draw[timeline color st]([yshift=-lineoffset]vtimelinethevtml.south west)--
([yshift=-lineoffset]vtimelinethevtml.south east);
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 phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
begin{vtimeline}[timeline color=cyan!80!blue, add bottom line, line offset=2pt]
1947 & AT and T Bell Labs develop the idea of cellular phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
end{document}
In the first environment the header is activated. The result is:
In the second environment the header is not set up, but a line is added at the bottom of the timeline with a custom offset (default 4pt
). In addition, the color is different and no constraints have been put on the description width:
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
letmatamp=&
catcode`&=13
makeatletter
def&{iftikz@is@matrix
pgfmatrixnextcell
else
matamp
fi}
makeatother
newcounter{lines}
defendlr{stepcounter{lines}\}
newcounter{vtml}
setcounter{vtml}{0}
newififvtimelinetitle
newififvtimebottomline
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,
add bottom line/.is if=vtimebottomline,
add bottom line=false,
timeline title/.store in=vtimelinetitle,
timeline title={},
line offset/.store in=lineoffset,
line offset=4pt,
}
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(vtimelinethevtml)[matrix of nodes]{BODY};
pgfmathtruncatemacroendmtx{thelines-1}
path[timeline color st]
($(vtimelinethevtml-1-1.north east)!0.5!(vtimelinethevtml-1-2.north west)$)--
($(vtimelinethevtml-endmtx-1.south east)!0.5!(vtimelinethevtml-endmtx-2.south west)$);
foreach x in {1,...,endmtx}{
node[circle,timeline color st, inner sep=0.15pt, draw=white, thick]
(vtimelinethevtml-c-x) at
($(vtimelinethevtml-x-1.east)!0.5!(vtimelinethevtml-x-2.west)$){};
draw[timeline color st](vtimelinethevtml-c-x.west)--++(-3pt,0);
}
ifvtimelinetitle%
draw[timeline color st]([yshift=lineoffset]vtimelinethevtml.north west)--
([yshift=lineoffset]vtimelinethevtml.north east);
node[anchor=west,yshift=16pt,font=large]
at (vtimelinethevtml-1-1.north west)
{textsc{Timeline thevtml}: textit{vtimelinetitle}};
else%
relax%
fi%
ifvtimebottomline%
draw[timeline color st]([yshift=-lineoffset]vtimelinethevtml.south west)--
([yshift=-lineoffset]vtimelinethevtml.south east);
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 phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
begin{vtimeline}[timeline color=cyan!80!blue, add bottom line, line offset=2pt]
1947 & AT and T Bell Labs develop the idea of cellular phonesendlr
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'endlr
1971 & Busicom 'Handy-LE' Calculatorendlr
1973 & First mobile handset invented by Martin Cooperendlr
1978 & Parker Bros. Merlin Computer Toyendlr
1981 & Osborne 1 Portable Computerendlr
1982 & Grid Compass 1100 Clamshell Laptopendlr
1983 & TRS-80 Model 100 Portable PCendlr
1984 & Psion Organiser Handheld Computerendlr
1991 & Psion Series 3 Minicomputerendlr
end{vtimeline}
end{document}
In the first environment the header is activated. The result is:
In the second environment the header is not set up, but a line is added at the bottom of the timeline with a custom offset (default 4pt
). In addition, the color is different and no constraints have been put on the description width:
edited Jan 13 '15 at 12:10
answered Aug 22 '14 at 9:07
Claudio Fiandrino
52k11152303
52k11152303
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
add a comment |
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
This looks and works great. How would one go about adding a horizontal line below the timeline as well as above?
– Casimir
Jan 9 '15 at 16:16
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: Thanks! Actually it is not complicated: I'll try to give you a feedback on this in the next days.
– Claudio Fiandrino
Jan 9 '15 at 16:32
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
@PacificOrion: I just revised the answer to include a line below the timeline.
– Claudio Fiandrino
Jan 13 '15 at 12:11
add a comment |
up vote
16
down vote
Here is another variation using tikz to produce:
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%
} { ifnumy=1 node[description](y){desc};
elsenode[description,below=1ex of z](y){desc};
fi
node[year](y-y) [left=of y] {year};
ifnumy>1draw[timeline] (y-z)-- (y-y);fi
globalletz=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...
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
add a comment |
up vote
16
down vote
Here is another variation using tikz to produce:
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%
} { ifnumy=1 node[description](y){desc};
elsenode[description,below=1ex of z](y){desc};
fi
node[year](y-y) [left=of y] {year};
ifnumy>1draw[timeline] (y-z)-- (y-y);fi
globalletz=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...
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
add a comment |
up vote
16
down vote
up vote
16
down vote
Here is another variation using tikz to produce:
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%
} { ifnumy=1 node[description](y){desc};
elsenode[description,below=1ex of z](y){desc};
fi
node[year](y-y) [left=of y] {year};
ifnumy>1draw[timeline] (y-z)-- (y-y);fi
globalletz=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...
Here is another variation using tikz to produce:
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%
} { ifnumy=1 node[description](y){desc};
elsenode[description,below=1ex of z](y){desc};
fi
node[year](y-y) [left=of y] {year};
ifnumy>1draw[timeline] (y-z)-- (y-y);fi
globalletz=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...
edited Aug 18 '14 at 3:47
answered Aug 18 '14 at 3:33
Andrew
30.3k34380
30.3k34380
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
add a comment |
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
1
1
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
Nothing quite like a friendly unexplained down-vote....
– Andrew
Nov 14 '17 at 8:11
add a comment |
up vote
11
down vote
Here is a modified version of chronology.sty
, chronology-vert.sty
. Note that this is not at all well-tested and is liable to break. In particular, the timeline is not boxed or resized, so the user must ensure that things fit appropriately.
Caveat emptor...
%% Modifications copyright 2015 Clea F. Rees
%% Code from origfile copyright 2011 Levi Wiseman (see below)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Clea F. Rees.
%%
%% This work consists of the file chronology-vert.sty.
%%
%% chronology-vert.sty is a derived work under the terms of the LPPL.
%% The original file, chronology.sty, is supplied with chronology. A
%% copy of chronology including an unmodified copy of chronology.sty
%% is available from
%% http://ctan.org/tex-archive/macros/latex/contrib/chronology.
%%
%% The main modifications made to this file are as follows:
%% - This notice is added.
%% - The file is renamed.
%% - The timeline is created as a vertical, rather than horizontal
%% progression.
%% - The timeline is not boxed or resized. Hence, it is up to the user
%% to ensure that things fit appropriately.
% based on chronology 2010/6/12 v1.0 Horizontal timeline
NeedsTeXFormat{LaTeX2e}%
ProvidesPackage{chronology-vert}[2015/05/02 v1.0 Horizontal timeline]
RequirePackage{calc}
RequirePackage{tikz}
RequirePackage{ifthen}
newcounter{step}newcounter{stepstart}newcounter{stepstop}
newcounter{yearstart}newcounter{yearstop}newcounter{deltayears}
newlength{ystart}newlength{ystop}
newlength{unit}newlength{timelineheight}
makeatletter
newififchronology@star
newenvironment{chronology}{%
@ifstar{chronology@startruechronology@i*}{chronology@starfalsechronology@i*}%
}{%
end{tikzpicture}%
}%
defchronology@i*{%
@ifnextchar[{chronology@ii*}{chronology@ii*[{5}]}%
}%
defchronology@ii*[#1]#2#3#4{%
@ifnextchar[{chronology@iii*[{#1}]{#2}{#3}{#4}}{chronology@iii*[{#1}]{#2}{#3}{#4}[{#4}]}%
}%
defchronology@iii*[#1]#2#3#4[#5]{%
newififflipped%
ifchronology@star%
flippedtrue%
else%
flippedfalse%
fi%
setcounter{step}{#1}%
setcounter{yearstart}{#2}setcounter{yearstop}{#3}%
setcounter{deltayears}{theyearstop-theyearstart}%
setlength{unit}{#5/thedeltayears}%
setlength{timelineheight}{#4}%
pgfmathsetcounter{stepstart}{theyearstart+thestep-mod(theyearstart,thestep)}%
pgfmathsetcounter{stepstop}{theyearstop-mod(theyearstop,thestep)}%
addtocounter{step}{thestepstart}%
begin{tikzpicture}[baseline={(current bounding box.north)}]%
draw [|->] (0,0) -- (0,-thedeltayears*unit-unit);%
foreach y in {1,...,thedeltayears}%
draw[yshift=-y*unit] (-.1unit,0) -- (.1unit,0);%
addtocounter{deltayears}{1}%
foreach y in {thestepstart,thestep,...,thestepstop}{%
pgfmathsetlengthystop{(-y+theyearstart)*unit}%
draw[yshift=ystop] (-.3unit,0) -- (.3unit,0);%
ifflipped%
node at (0,ystop) [left=.2unit] {y};%
else%
node at (0,ystop) [right=.2unit] {y};%
fi%
}%
}%
makeatother
newcommand{event}[3][e]{%
pgfmathsetlengthystop{(#2-theyearstart)*unit}%
ifx #1e%
ifflipped%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,right=.5unit] {#3};%
else%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,left=.5unit] {#3};%
fi%
else%
pgfmathsetlengthystart{(#1-theyearstart)*unit}%
ifflipped%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,right=.5unit] {#3} (.2unit,-ystop);%
else%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,left=.5unit] {#3} (.2unit,-ystop);%
fi%
fi}
newcommand{decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}
endinput
The example file provided with the chronology
package produces the following if chronology-vert
is used instead (and the vertical spacing removed):
Applying this to the original example:
documentclass[tikz,border=5pt]{standalone}
usepackage{chronology-vert}
begin{document}
begin{chronology}*[5]{1940}{1995}{20cm}
event{1947}{AT and T Bell Labs develop the idea of cellular phones}
event{1968}{Xerox Palo Alto Research Centre envisage the 'Dynabook}
event{1971}{Busicom 'Handy-LE' Calculator}
event{1973}{First mobile handset invented by Martin Cooper}
event{1978}{Parker Bros. Merlin Computer Toy}
event{1981}{Osborne 1 Portable Computer}
event{1982}{Grid Compass 1100 Clamshell Laptop}
event{1983}{TRS-80 Model 100 Portable PC}
event{1984}{Psion Organiser Handheld Computer}
event{1991}{Psion Series 3 Minicomputer}
end{chronology}
end{document}
produces:
add a comment |
up vote
11
down vote
Here is a modified version of chronology.sty
, chronology-vert.sty
. Note that this is not at all well-tested and is liable to break. In particular, the timeline is not boxed or resized, so the user must ensure that things fit appropriately.
Caveat emptor...
%% Modifications copyright 2015 Clea F. Rees
%% Code from origfile copyright 2011 Levi Wiseman (see below)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Clea F. Rees.
%%
%% This work consists of the file chronology-vert.sty.
%%
%% chronology-vert.sty is a derived work under the terms of the LPPL.
%% The original file, chronology.sty, is supplied with chronology. A
%% copy of chronology including an unmodified copy of chronology.sty
%% is available from
%% http://ctan.org/tex-archive/macros/latex/contrib/chronology.
%%
%% The main modifications made to this file are as follows:
%% - This notice is added.
%% - The file is renamed.
%% - The timeline is created as a vertical, rather than horizontal
%% progression.
%% - The timeline is not boxed or resized. Hence, it is up to the user
%% to ensure that things fit appropriately.
% based on chronology 2010/6/12 v1.0 Horizontal timeline
NeedsTeXFormat{LaTeX2e}%
ProvidesPackage{chronology-vert}[2015/05/02 v1.0 Horizontal timeline]
RequirePackage{calc}
RequirePackage{tikz}
RequirePackage{ifthen}
newcounter{step}newcounter{stepstart}newcounter{stepstop}
newcounter{yearstart}newcounter{yearstop}newcounter{deltayears}
newlength{ystart}newlength{ystop}
newlength{unit}newlength{timelineheight}
makeatletter
newififchronology@star
newenvironment{chronology}{%
@ifstar{chronology@startruechronology@i*}{chronology@starfalsechronology@i*}%
}{%
end{tikzpicture}%
}%
defchronology@i*{%
@ifnextchar[{chronology@ii*}{chronology@ii*[{5}]}%
}%
defchronology@ii*[#1]#2#3#4{%
@ifnextchar[{chronology@iii*[{#1}]{#2}{#3}{#4}}{chronology@iii*[{#1}]{#2}{#3}{#4}[{#4}]}%
}%
defchronology@iii*[#1]#2#3#4[#5]{%
newififflipped%
ifchronology@star%
flippedtrue%
else%
flippedfalse%
fi%
setcounter{step}{#1}%
setcounter{yearstart}{#2}setcounter{yearstop}{#3}%
setcounter{deltayears}{theyearstop-theyearstart}%
setlength{unit}{#5/thedeltayears}%
setlength{timelineheight}{#4}%
pgfmathsetcounter{stepstart}{theyearstart+thestep-mod(theyearstart,thestep)}%
pgfmathsetcounter{stepstop}{theyearstop-mod(theyearstop,thestep)}%
addtocounter{step}{thestepstart}%
begin{tikzpicture}[baseline={(current bounding box.north)}]%
draw [|->] (0,0) -- (0,-thedeltayears*unit-unit);%
foreach y in {1,...,thedeltayears}%
draw[yshift=-y*unit] (-.1unit,0) -- (.1unit,0);%
addtocounter{deltayears}{1}%
foreach y in {thestepstart,thestep,...,thestepstop}{%
pgfmathsetlengthystop{(-y+theyearstart)*unit}%
draw[yshift=ystop] (-.3unit,0) -- (.3unit,0);%
ifflipped%
node at (0,ystop) [left=.2unit] {y};%
else%
node at (0,ystop) [right=.2unit] {y};%
fi%
}%
}%
makeatother
newcommand{event}[3][e]{%
pgfmathsetlengthystop{(#2-theyearstart)*unit}%
ifx #1e%
ifflipped%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,right=.5unit] {#3};%
else%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,left=.5unit] {#3};%
fi%
else%
pgfmathsetlengthystart{(#1-theyearstart)*unit}%
ifflipped%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,right=.5unit] {#3} (.2unit,-ystop);%
else%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,left=.5unit] {#3} (.2unit,-ystop);%
fi%
fi}
newcommand{decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}
endinput
The example file provided with the chronology
package produces the following if chronology-vert
is used instead (and the vertical spacing removed):
Applying this to the original example:
documentclass[tikz,border=5pt]{standalone}
usepackage{chronology-vert}
begin{document}
begin{chronology}*[5]{1940}{1995}{20cm}
event{1947}{AT and T Bell Labs develop the idea of cellular phones}
event{1968}{Xerox Palo Alto Research Centre envisage the 'Dynabook}
event{1971}{Busicom 'Handy-LE' Calculator}
event{1973}{First mobile handset invented by Martin Cooper}
event{1978}{Parker Bros. Merlin Computer Toy}
event{1981}{Osborne 1 Portable Computer}
event{1982}{Grid Compass 1100 Clamshell Laptop}
event{1983}{TRS-80 Model 100 Portable PC}
event{1984}{Psion Organiser Handheld Computer}
event{1991}{Psion Series 3 Minicomputer}
end{chronology}
end{document}
produces:
add a comment |
up vote
11
down vote
up vote
11
down vote
Here is a modified version of chronology.sty
, chronology-vert.sty
. Note that this is not at all well-tested and is liable to break. In particular, the timeline is not boxed or resized, so the user must ensure that things fit appropriately.
Caveat emptor...
%% Modifications copyright 2015 Clea F. Rees
%% Code from origfile copyright 2011 Levi Wiseman (see below)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Clea F. Rees.
%%
%% This work consists of the file chronology-vert.sty.
%%
%% chronology-vert.sty is a derived work under the terms of the LPPL.
%% The original file, chronology.sty, is supplied with chronology. A
%% copy of chronology including an unmodified copy of chronology.sty
%% is available from
%% http://ctan.org/tex-archive/macros/latex/contrib/chronology.
%%
%% The main modifications made to this file are as follows:
%% - This notice is added.
%% - The file is renamed.
%% - The timeline is created as a vertical, rather than horizontal
%% progression.
%% - The timeline is not boxed or resized. Hence, it is up to the user
%% to ensure that things fit appropriately.
% based on chronology 2010/6/12 v1.0 Horizontal timeline
NeedsTeXFormat{LaTeX2e}%
ProvidesPackage{chronology-vert}[2015/05/02 v1.0 Horizontal timeline]
RequirePackage{calc}
RequirePackage{tikz}
RequirePackage{ifthen}
newcounter{step}newcounter{stepstart}newcounter{stepstop}
newcounter{yearstart}newcounter{yearstop}newcounter{deltayears}
newlength{ystart}newlength{ystop}
newlength{unit}newlength{timelineheight}
makeatletter
newififchronology@star
newenvironment{chronology}{%
@ifstar{chronology@startruechronology@i*}{chronology@starfalsechronology@i*}%
}{%
end{tikzpicture}%
}%
defchronology@i*{%
@ifnextchar[{chronology@ii*}{chronology@ii*[{5}]}%
}%
defchronology@ii*[#1]#2#3#4{%
@ifnextchar[{chronology@iii*[{#1}]{#2}{#3}{#4}}{chronology@iii*[{#1}]{#2}{#3}{#4}[{#4}]}%
}%
defchronology@iii*[#1]#2#3#4[#5]{%
newififflipped%
ifchronology@star%
flippedtrue%
else%
flippedfalse%
fi%
setcounter{step}{#1}%
setcounter{yearstart}{#2}setcounter{yearstop}{#3}%
setcounter{deltayears}{theyearstop-theyearstart}%
setlength{unit}{#5/thedeltayears}%
setlength{timelineheight}{#4}%
pgfmathsetcounter{stepstart}{theyearstart+thestep-mod(theyearstart,thestep)}%
pgfmathsetcounter{stepstop}{theyearstop-mod(theyearstop,thestep)}%
addtocounter{step}{thestepstart}%
begin{tikzpicture}[baseline={(current bounding box.north)}]%
draw [|->] (0,0) -- (0,-thedeltayears*unit-unit);%
foreach y in {1,...,thedeltayears}%
draw[yshift=-y*unit] (-.1unit,0) -- (.1unit,0);%
addtocounter{deltayears}{1}%
foreach y in {thestepstart,thestep,...,thestepstop}{%
pgfmathsetlengthystop{(-y+theyearstart)*unit}%
draw[yshift=ystop] (-.3unit,0) -- (.3unit,0);%
ifflipped%
node at (0,ystop) [left=.2unit] {y};%
else%
node at (0,ystop) [right=.2unit] {y};%
fi%
}%
}%
makeatother
newcommand{event}[3][e]{%
pgfmathsetlengthystop{(#2-theyearstart)*unit}%
ifx #1e%
ifflipped%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,right=.5unit] {#3};%
else%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,left=.5unit] {#3};%
fi%
else%
pgfmathsetlengthystart{(#1-theyearstart)*unit}%
ifflipped%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,right=.5unit] {#3} (.2unit,-ystop);%
else%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,left=.5unit] {#3} (.2unit,-ystop);%
fi%
fi}
newcommand{decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}
endinput
The example file provided with the chronology
package produces the following if chronology-vert
is used instead (and the vertical spacing removed):
Applying this to the original example:
documentclass[tikz,border=5pt]{standalone}
usepackage{chronology-vert}
begin{document}
begin{chronology}*[5]{1940}{1995}{20cm}
event{1947}{AT and T Bell Labs develop the idea of cellular phones}
event{1968}{Xerox Palo Alto Research Centre envisage the 'Dynabook}
event{1971}{Busicom 'Handy-LE' Calculator}
event{1973}{First mobile handset invented by Martin Cooper}
event{1978}{Parker Bros. Merlin Computer Toy}
event{1981}{Osborne 1 Portable Computer}
event{1982}{Grid Compass 1100 Clamshell Laptop}
event{1983}{TRS-80 Model 100 Portable PC}
event{1984}{Psion Organiser Handheld Computer}
event{1991}{Psion Series 3 Minicomputer}
end{chronology}
end{document}
produces:
Here is a modified version of chronology.sty
, chronology-vert.sty
. Note that this is not at all well-tested and is liable to break. In particular, the timeline is not boxed or resized, so the user must ensure that things fit appropriately.
Caveat emptor...
%% Modifications copyright 2015 Clea F. Rees
%% Code from origfile copyright 2011 Levi Wiseman (see below)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Clea F. Rees.
%%
%% This work consists of the file chronology-vert.sty.
%%
%% chronology-vert.sty is a derived work under the terms of the LPPL.
%% The original file, chronology.sty, is supplied with chronology. A
%% copy of chronology including an unmodified copy of chronology.sty
%% is available from
%% http://ctan.org/tex-archive/macros/latex/contrib/chronology.
%%
%% The main modifications made to this file are as follows:
%% - This notice is added.
%% - The file is renamed.
%% - The timeline is created as a vertical, rather than horizontal
%% progression.
%% - The timeline is not boxed or resized. Hence, it is up to the user
%% to ensure that things fit appropriately.
% based on chronology 2010/6/12 v1.0 Horizontal timeline
NeedsTeXFormat{LaTeX2e}%
ProvidesPackage{chronology-vert}[2015/05/02 v1.0 Horizontal timeline]
RequirePackage{calc}
RequirePackage{tikz}
RequirePackage{ifthen}
newcounter{step}newcounter{stepstart}newcounter{stepstop}
newcounter{yearstart}newcounter{yearstop}newcounter{deltayears}
newlength{ystart}newlength{ystop}
newlength{unit}newlength{timelineheight}
makeatletter
newififchronology@star
newenvironment{chronology}{%
@ifstar{chronology@startruechronology@i*}{chronology@starfalsechronology@i*}%
}{%
end{tikzpicture}%
}%
defchronology@i*{%
@ifnextchar[{chronology@ii*}{chronology@ii*[{5}]}%
}%
defchronology@ii*[#1]#2#3#4{%
@ifnextchar[{chronology@iii*[{#1}]{#2}{#3}{#4}}{chronology@iii*[{#1}]{#2}{#3}{#4}[{#4}]}%
}%
defchronology@iii*[#1]#2#3#4[#5]{%
newififflipped%
ifchronology@star%
flippedtrue%
else%
flippedfalse%
fi%
setcounter{step}{#1}%
setcounter{yearstart}{#2}setcounter{yearstop}{#3}%
setcounter{deltayears}{theyearstop-theyearstart}%
setlength{unit}{#5/thedeltayears}%
setlength{timelineheight}{#4}%
pgfmathsetcounter{stepstart}{theyearstart+thestep-mod(theyearstart,thestep)}%
pgfmathsetcounter{stepstop}{theyearstop-mod(theyearstop,thestep)}%
addtocounter{step}{thestepstart}%
begin{tikzpicture}[baseline={(current bounding box.north)}]%
draw [|->] (0,0) -- (0,-thedeltayears*unit-unit);%
foreach y in {1,...,thedeltayears}%
draw[yshift=-y*unit] (-.1unit,0) -- (.1unit,0);%
addtocounter{deltayears}{1}%
foreach y in {thestepstart,thestep,...,thestepstop}{%
pgfmathsetlengthystop{(-y+theyearstart)*unit}%
draw[yshift=ystop] (-.3unit,0) -- (.3unit,0);%
ifflipped%
node at (0,ystop) [left=.2unit] {y};%
else%
node at (0,ystop) [right=.2unit] {y};%
fi%
}%
}%
makeatother
newcommand{event}[3][e]{%
pgfmathsetlengthystop{(#2-theyearstart)*unit}%
ifx #1e%
ifflipped%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,right=.5unit] {#3};%
else%
draw[fill=black,draw=none,opacity=0.5]%
(0,-ystop) circle (.2unit)%
node[opacity=1,rotate=30,left=.5unit] {#3};%
fi%
else%
pgfmathsetlengthystart{(#1-theyearstart)*unit}%
ifflipped%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,right=.5unit] {#3} (.2unit,-ystop);%
else%
draw[fill=black,draw=none,opacity=0.5,rounded corners=.2unit]%
(-.2unit,-ystart) rectangle%
node[opacity=1,rotate=30,left=.5unit] {#3} (.2unit,-ystop);%
fi%
fi}
newcommand{decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}
endinput
The example file provided with the chronology
package produces the following if chronology-vert
is used instead (and the vertical spacing removed):
Applying this to the original example:
documentclass[tikz,border=5pt]{standalone}
usepackage{chronology-vert}
begin{document}
begin{chronology}*[5]{1940}{1995}{20cm}
event{1947}{AT and T Bell Labs develop the idea of cellular phones}
event{1968}{Xerox Palo Alto Research Centre envisage the 'Dynabook}
event{1971}{Busicom 'Handy-LE' Calculator}
event{1973}{First mobile handset invented by Martin Cooper}
event{1978}{Parker Bros. Merlin Computer Toy}
event{1981}{Osborne 1 Portable Computer}
event{1982}{Grid Compass 1100 Clamshell Laptop}
event{1983}{TRS-80 Model 100 Portable PC}
event{1984}{Psion Organiser Handheld Computer}
event{1991}{Psion Series 3 Minicomputer}
end{chronology}
end{document}
produces:
answered May 2 '15 at 23:23
cfr
156k7183377
156k7183377
add a comment |
add a comment |
up vote
9
down vote
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}
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
add a comment |
up vote
9
down vote
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}
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
add a comment |
up vote
9
down vote
up vote
9
down vote
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}
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}
edited Mar 20 '16 at 9:40
answered Aug 17 '14 at 23:28
Svend Tveskæg
20.6k1050136
20.6k1050136
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
add a comment |
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
4
4
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
Compare your table with the OP's...
– Andrew
Aug 18 '14 at 6:47
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f196794%2fhow-can-you-create-a-vertical-timeline%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Perhaps this is is what you want?
– Andrew
Aug 18 '14 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 '14 at 2:16
Was just thinking to create such a timeline from scratch. Nice idea. I'd like to explore the idea of having two colums, and the vertical timeline as a separator with entries alternating between the left and right column.
– Nikos Alexandris
Jul 9 '15 at 16:46
1
Off-topic: Please write
AT&T
, notAT and T
.– Mico
Oct 27 '16 at 5:53