Graphics, Figures & TablesCreate a timeline

Information and discussion about graphics, figures & tables in LaTeX documents.
dirkst19
Posts: 1
Joined: Sat May 16, 2015 9:48 am

Create a timeline

Post by dirkst19 »

Hello everybody!

I need to create a couple of timelines that I've made ​​only with Visio . I would now like to implement in latex , but I have simply no idea about this .

I'll send a pic with added , as the timeline should look like .
The individual events should be displayed before the time.
example.png
example.png (6.61 KiB) Viewed 27414 times
Maybe someone already done something similar or have an idea?
I would be very happy about it

Thank you ! = )

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Create a timeline

Post by Johannes_B »

This question has also been asked at goLaTeX, our german partner site, and on TeXwelt.de.
Last edited by Stefan Kottwitz on Sun May 17, 2015 11:19 am, edited 1 time in total.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Create a timeline

Post by Stefan Kottwitz »

Welcome to the forum!

Here is a different idea of a time line, based on the TikZ timeline library. I created it as an example for my next book. Maybe it's also interesting for you.

Code: Select all

\documentclass[a3paper]{article} 
\usepackage[landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{timeline}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
  \timeline{5}
  \begin{phases}
    \initialphase{involvement degree=3cm,phase color=blue}
    \phase{between week=1 and 2 in 0.4,
      involvement degree=5cm,phase color=green!50!black}
    \phase{between week=2 and 3 in 0.2,
      involvement degree=6cm,phase color=red!40!black}
    \phase{between week=3 and 4 in 0.5,
      involvement degree=3cm,phase color=red!90!black}
    \phase{between week=4 and 5 in 0.3,
      involvement degree=2.5cm,phase color=red!40!yellow}
  \end{phases}
  \node [xshift=-0.6cm,yshift=1cm,anchor=east,
         font=\Large\bfseries] at (phase-0.180) {Auhor};
  \node [xshift=-0.6cm,yshift=-1cm,anchor=east,
         font=\Large\bfseries] at (phase-0.180) {Publisher};
  \begin{scope}{text options={above}}
    \addmilestone{at=phase-0.120,direction=120:1cm,
      text={Concept}}
    \addmilestone{at=phase-0.90,direction=90:1.2cm,
      text={Outline}}
    \addmilestone{at=phase-1.110,direction=110:1.5cm,
      text={Research}}
    \addmilestone{at=phase-2.100,direction=100:1cm,
      text={Writing}}
    \addmilestone{at=phase-2.60,direction=90:1.5cm,
      text={First draft}}
    \addmilestone{at=phase-3.90,direction=90:1.2cm,
      text={Second draft}}
    \addmilestone{at=phase-4.90,direction=90:0.8cm,
      text={Approval of print draft}}
  \end{scope}
  \begin{scope}{text options={below}}
    \addmilestone{at=phase-0.270,direction=270:1cm,
      text={Concept Review}}
    \addmilestone{at=phase-2.270,direction=270:1cm,
      text={First Review}}
    \addmilestone{at=phase-3.250,direction=250:0.8cm,
      text={Second Review}}
    \addmilestone{at=phase-3.300,direction=270:1.5cm,
      text={Approval required}}
    \addmilestone{at=phase-4.260,direction=270:2.2cm,
      text={Draft for printing}}
    \addmilestone{at=phase-4.300,direction=300:1cm,
      text={Publication}}
  \end{scope}
\end{tikzpicture}
\end{document}
timeline.png
timeline.png (31.13 KiB) Viewed 27434 times
Also your image could easily created with TikZ. Johannes already mentioned goLaTeX.de, and I know there are TikZ drawing experts on TeXwelt.de (also a friend of us). Btw. I don't see problems with cross posts, as long as there's a link to the other site where it's posted. So kindly post a link to the parallel discussion each time, for example if you would post the same question to TeXwelt.de. But feel free to post further questions to TeXwelt or LaTeX-Community.org, we love good questions and like drawing things too. It's just that we more support in improving drawings and helping with questions, not really a drawing service. ;-)

Stefan
LaTeX.org admin
ossenna
Posts: 2
Joined: Wed Jun 03, 2015 9:51 pm

Create a timeline

Post by ossenna »

Hi

Im a rather new user of LaTeX and I would love to make a similar timeline as yours.
Could you please indicate me what I need to install ? I ask because I get Package Tikz Error: I did not find the tikz 'timeline'.,while trying to compile in pdfLaTeX.

Thanks!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Create a timeline

Post by Stefan Kottwitz »

Hi Ossenna,

welcome to the forum!

You need to install the timeline library. You can download the file tikzlibrarytimeline.code.tex and copy it to your document folder (or to your TeX installation).

Stefan
LaTeX.org admin
ossenna
Posts: 2
Joined: Wed Jun 03, 2015 9:51 pm

Re: Create a timeline

Post by ossenna »

Thanks for your answer, Stefan!

I'm working on it and I have two detail problems with the milestones
1 they are too close to the line.
2 i'd like to be able to add more text - maybe change fonts or break line

Can you give me a hint on how to fix that ?<


Thanks !
Attachments
Capture d’écran 2015-06-10 à 14.58.30.png
Capture d’écran 2015-06-10 à 14.58.30.png (45.96 KiB) Viewed 27265 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Create a timeline

Post by Stefan Kottwitz »

  1. Can be fixed by directly setting the above or below key:

    Code: Select all

    \addmilestone{at=phase-0.120,direction=120:1cm,
      text={Text},text options={above}}
    The setting for text options is remembered until you change it, so no need to repeat it.
  2. You can set the width as option too, such as

    Code: Select all

    \addmilestone{at=phase-0.120,direction=120:1cm,
      text={Very long long long text},text options={above,text width=5em}}
Stefan
LaTeX.org admin
siriliverpool
Posts: 2
Joined: Mon Dec 10, 2018 5:47 pm

Create a timeline

Post by siriliverpool »

Hi,

I really like your timeline, can you tell me please how you can change the timeline by months but use, Months 1-3, months 4-6, and months 7-9 and month 10-12 ?

thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Create a timeline

Post by Stefan Kottwitz »

You can use custom intervals. Here is an example:

Code: Select all

\documentclass[a3paper]{article} 
\usepackage[landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{timeline}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[timespan={}, font=\sffamily]
   \timeline[custom interval=true]{Months 1-3, Months 4-6, Months 7-9, Months 10-12}
   \begin{phases}
     \initialphase{involvement degree=3cm,phase color=blue}
     \phase{between week=1 and 2 in 0.4,
       involvement degree=5cm,phase color=green!50!black}
     \phase{between week=2 and 3 in 0.2,
       involvement degree=6cm,phase color=red!40!black}
     \phase{between week=3 and 4 in 0.5,
       involvement degree=3cm,phase color=red!90!black}
   \end{phases}
   \node [xshift=-0.6cm,yshift=1cm,anchor=east,
          font=\Large\bfseries] at (phase-0.180) {Auhor};
   \node [xshift=-0.6cm,yshift=-1cm,anchor=east,
          font=\Large\bfseries] at (phase-0.180) {Publisher};
   \begin{scope}{text options={above}}
     \addmilestone{at=phase-0.120,direction=120:1cm,
       text={Concept},text options={above}}
     \addmilestone{at=phase-0.90,direction=90:1.2cm,
       text={Outline}}
     \addmilestone{at=phase-1.110,direction=110:1.5cm,
       text={Research}}
     \addmilestone{at=phase-2.100,direction=100:1cm,
       text={Writing}}
     \addmilestone{at=phase-2.60,direction=90:1.5cm,
       text={First draft}}
     \addmilestone{at=phase-3.90,direction=90:1.2cm,
       text={Second draft}}
   \end{scope}
   \begin{scope}{text options={below}}
     \addmilestone{at=phase-0.270,direction=270:1cm,
       text={Concept Review},text options={below}}
     \addmilestone{at=phase-2.270,direction=270:1cm,
       text={First Review}}
     \addmilestone{at=phase-3.250,direction=250:0.8cm,
       text={Second Review}}
     \addmilestone{at=phase-3.300,direction=270:1.5cm,
       text={Approval required}}
   \end{scope}
\end{tikzpicture}
\end{document}
timeline.png
timeline.png (28.38 KiB) Viewed 19385 times
Stefan
LaTeX.org admin
siriliverpool
Posts: 2
Joined: Mon Dec 10, 2018 5:47 pm

Create a timeline

Post by siriliverpool »

Thanks a lot ! it's gorgeous :twisted:
Post Reply