# Modifying a timeline in beamer

I have found the code in this selected answer of this questions How can I make a standard timeline?

and I modified it to achieve what I want.

\documentclass[svgnames]{beamer}

\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

%\usepackage[margin=3cm]{geometry}
\usepackage{ragged2e}
\usepackage{fourier}
\usepackage{tikz}
\usetikzlibrary{chains,shapes.arrows,fit}

\definecolor{arrowcolor}{RGB}{201,216,232}% color for the arrow filling
\definecolor{circlecolor}{RGB}{79,129,189}% color for the inner circles filling
\colorlet{textcolor}{white}% color for the text inside the circles
\colorlet{bordercolor}{white}% color for the outer border of circles

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newlength\taskwidth% width of the box for the task description
\newlength\taskvsep% vertical distance between the task description and arrow

\tikzset{
inner/.style={
on chain,
circle,
inner sep=4pt,
fill=circlecolor,
line width=1.5pt,
draw=bordercolor,
text width=1.2em,
align=center,
text height=1.25ex,
text depth=0ex
},
on grid
}

\node[inner xsep=0pt] (c1) {\phantom{A}};
\else
\fi
\node[inner,font=\footnotesize\sffamily\color{textcolor}]
}

\newcommand\drawarrow{% the arrow is placed in the background layer
% after the node for the tasks have been placed
\node[on chain] (c1) {}; % if no \Task command is used, the arrow will be drawn
\fi
\node[on chain] (f) {};
\begin{pgfonlayer}{background}
\node[
inner sep=10pt,
single arrow,
single arrow head extend=0.8cm,
draw=none,
fill=arrowcolor,
fit= (c1) (f)
] (arrow) {};
\fill[white] % the decoration at the tail of the arrow
(arrow.before tail) -- (c1|-arrow.west) -- (arrow.after tail) -- cycle;
\end{pgfonlayer}
}

{\par\noindent\begin{tikzpicture}[start chain,#1]}
{\drawarrow\end{tikzpicture}\par}

\begin{document}

\begin{frame}
\begin{columns}
\column{13cm}
\begin{timeline}
\Task{Maitrise Physique\\Magistère Mécanique\\ 1997-2005}
\Task{Enseignant\\(M, L, Prépa, Secondaire) \\ 2009-2012}
\Task{ATER/LRU \\ Depuis 2016}
\end{timeline}

\vspace{1cm}

\definecolor{arrowcolor}{RGB}{144,168,65}
\colorlet{circlecolor}{white}
\definecolor{bordercolor}{RGB}{168,89,65}
\colorlet{textcolor}{bordercolor}

%\begin{timeline}
%\Task[M]{Grilled cheese sandwiches on whole-wheat bread, one peach}
%\Task[W]{Zucchini muffins with cream cheese, grapes, and watermelon}
%\Task[Th]{Peanut butter and banana sandwiches, popcorn, one peach}
%\Task[F]{Cream cheese and cucumber sandwich, grapes, and blueberries}
%\Task[Sa]{Grilled fish with lemon, grilled corn, and whole-wheat biscuits}
%\Task[Su]{Yogurth with honey and blueberries}
%\end{timeline}

\end{columns}
\end{frame}

\end{document}

The slide with the timeline I got, looks like

As we see the content does not fit into a single slide. How should I modify above code in order to do so?

Also, I want to add vertical lines below or above each circle accordingly to point to an associated text which will include the specific affiliation and the main activities. How is it possible to do this?

Thank you very much in advance.

You are allowed to add options to your picture

\documentclass[svgnames]{beamer}

\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

%\usepackage[margin=3cm]{geometry}
\usepackage{ragged2e}
\usepackage{fourier}
\usepackage{tikz}
\usetikzlibrary{chains,shapes.arrows,fit}

\definecolor{arrowcolor}{RGB}{201,216,232}% color for the arrow filling
\definecolor{circlecolor}{RGB}{79,129,189}% color for the inner circles filling
\colorlet{textcolor}{white}% color for the text inside the circles
\colorlet{bordercolor}{white}% color for the outer border of circles

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newlength\taskwidth% width of the box for the task description
\newlength\taskvsep% vertical distance between the task description and arrow

\tikzset{
inner/.style={
on chain,
circle,
inner sep=4pt,
fill=circlecolor,
line width=1.5pt,
draw=bordercolor,
text width=1.2em,
align=center,
text height=1.25ex,
text depth=0ex
},
on grid
}

\node[inner xsep=0pt] (c1) {\phantom{A}};
\else
\fi
\node[inner,font=\footnotesize\sffamily\color{textcolor}]
}

\newcommand\drawarrow{% the arrow is placed in the background layer
% after the node for the tasks have been placed
\node[on chain] (c1) {}; % if no \Task command is used, the arrow will be drawn
\fi
\node[on chain] (f) {};
\begin{pgfonlayer}{background}
\node[
inner sep=10pt,
single arrow,
single arrow head extend=0.8cm,
draw=none,
fill=arrowcolor,
fit= (c1) (f)
] (arrow) {};
\fill[white] % the decoration at the tail of the arrow
(arrow.before tail) -- (c1|-arrow.west) -- (arrow.after tail) -- cycle;
\end{pgfonlayer}
}

{\par\noindent\begin{tikzpicture}[start chain,#1]}
{\drawarrow\end{tikzpicture}\par}

\begin{document}

\begin{frame}
\begin{columns}
\column{13cm}
\Task{Maitrise Physique\\Magistère Mécanique\\ 1997-2005}
\Task{Enseignant\\(M, L, Prépa, Secondaire) \\ 2009-2012}
\Task{ATER/LRU \\ Depuis 2016}
\end{timeline}

\vspace{1cm}

\definecolor{arrowcolor}{RGB}{144,168,65}
\colorlet{circlecolor}{white}
\definecolor{bordercolor}{RGB}{168,89,65}
\colorlet{textcolor}{bordercolor}

%\begin{timeline}
%\Task[M]{Grilled cheese sandwiches on whole-wheat bread, one peach}
%\Task[W]{Zucchini muffins with cream cheese, grapes, and watermelon}
%\Task[Th]{Peanut butter and banana sandwiches, popcorn, one peach}
%\Task[F]{Cream cheese and cucumber sandwich, grapes, and blueberries}
%\Task[Sa]{Grilled fish with lemon, grilled corn, and whole-wheat biscuits}
%\Task[Su]{Yogurth with honey and blueberries}
%\end{timeline}

\end{columns}
\end{frame}

\end{document}

For the second question:

Also, I want to add vertical lines below or above each circle accordingly to point to an associated text which will include the specific affiliation and the main activities. How is it possible to do this?

Maybe like this?

\documentclass[svgnames]{beamer}

\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

%\usepackage[margin=3cm]{geometry}
\usepackage{ragged2e}
\usepackage{fourier}
\usepackage{tikz}
\usetikzlibrary{chains,shapes.arrows,fit}

\definecolor{arrowcolor}{RGB}{201,216,232}% color for the arrow filling
\definecolor{circlecolor}{RGB}{79,129,189}% color for the inner circles filling
\colorlet{textcolor}{white}% color for the text inside the circles
\colorlet{bordercolor}{white}% color for the outer border of circles

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\newlength\taskwidth% width of the box for the task description
\newlength\taskvsep% vertical distance between the task description and arrow

\tikzset{
inner/.style={
on chain,
circle,
inner sep=4pt,
fill=circlecolor,
line width=1.5pt,
draw=bordercolor,
text width=1.2em,
align=center,
text height=1.25ex,
text depth=0ex
},
on grid
}

\node[inner xsep=0pt] (c1) {\phantom{A}};
\else
\fi
\node[inner,font=\footnotesize\sffamily\color{textcolor}]
\draw[blue] (c\the\numexpr\value{task}+1\relax) -- (x);
}

\newcommand\drawarrow{% the arrow is placed in the background layer
% after the node for the tasks have been placed
\node[on chain] (c1) {}; % if no \Task command is used, the arrow will be drawn
\fi
\node[on chain] (f) {};
\begin{pgfonlayer}{background}
\node[
inner sep=10pt,
single arrow,
single arrow head extend=0.8cm,
draw=none,
fill=arrowcolor,
fit= (c1) (f)
] (arrow) {};
\fill[white] % the decoration at the tail of the arrow
(arrow.before tail) -- (c1|-arrow.west) -- (arrow.after tail) -- cycle;
\end{pgfonlayer}
}

{\par\noindent\begin{tikzpicture}[start chain,#1]}
{\drawarrow\end{tikzpicture}\par}

\begin{document}

\begin{frame}
\begin{columns}
\column{13cm}
\Task{Maitrise Physique\\Magistère Mécanique\\ 1997-2005}
\Task{Enseignant\\(M, L, Prépa, Secondaire) \\ 2009-2012}
\Task{ATER/LRU \\ Depuis 2016}
\end{timeline}

\vspace{1cm}

\definecolor{arrowcolor}{RGB}{144,168,65}
\colorlet{circlecolor}{white}
\definecolor{bordercolor}{RGB}{168,89,65}
\colorlet{textcolor}{bordercolor}

%\begin{timeline}
%\Task[M]{Grilled cheese sandwiches on whole-wheat bread, one peach}
%\Task[W]{Zucchini muffins with cream cheese, grapes, and watermelon}
%\Task[Th]{Peanut butter and banana sandwiches, popcorn, one peach}
%\Task[F]{Cream cheese and cucumber sandwich, grapes, and blueberries}
%\Task[Sa]{Grilled fish with lemon, grilled corn, and whole-wheat biscuits}
%\Task[Su]{Yogurth with honey and blueberries}
%\end{timeline}

\end{columns}
\end{frame}

\end{document}

In fact, all what we have to modify are some normal TikZ commands.

• Thank you very much! For the 2nd question: I want with the lines to point to associated texts a little further away that the main chronological arrow so that the latter does not contain a lot of things. I hope I am clear now! – Dimitris Apr 19 at 13:39
• @Dimitris Answer edited – JouleV Apr 19 at 13:48