1

I am a novice LaTeX user and trying to create a table similar to this one:

Output

I need circles where horizontal and vertical lines intersect but could not figure out how to do it. Will you please suggest me a way forward?

Thank you. Here is my code

\documentclass{beamer}
\usetheme{Berlin}
\usecolortheme{beaver}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{itemize item}[circle]
\setbeamertemplate{enumerate item}[circle]

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\usepackage{multicol}

\begin{document}
\begin{frame}{Literature}
\label{specific literature}
\begin{tabular}{ r r | c l } 
    Eren et al., (2019) &  & & \\ 
    \cline{2-2}
    & & &  \\
    Berrill et al., (2018) & & & \\ 
    & & & \\
    Lee et al., (2014) & & & Empirical Studies \\ 
    & & & \\
    Ayyagari and Kosová (2010) & & & \\ 
    & & & \\
    De Backer and Sleuwaegen (2003)& & & \\ 
    & & & \\ 
    & & &  \\
    Markusen and Venables (1999) & & & \\ 
    & & & \\
    Rodrìguez-Clare (1996)  & & & Theoretical Studies  \\ 
    & & & \\
    Grossman (1984) & & & \small    \hyperlink{literature}{\beamerskipbutton{Literature}} \\ 
\end{tabular}
\end{frame}
\end{document}
M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26

1 Answers1

1

I have made the same layout as in the picture using tikZ of course.

Output

\documentclass{beamer}
\usetheme{Berlin}
\usecolortheme{beaver}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{itemize item}[circle]
\setbeamertemplate{enumerate item}[circle]

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\usepackage{multicol}
\usepackage{tikz}

\begin{document}
\begin{frame}{Literature}
\begin{tikzpicture}[scale=0.5,every node/.style={outer sep=5pt}]
    %Notation: {year, the title of the event}
    %NOTE! Everyting is zero-based
    \def\ourInfo{{
        {"2016","Sometext here and there"},
        {"2017","long sometext here and there \\ sometext here and there sometext here and there"},
        {"2018","Another timline event that is in black"},
        {"2019","The last timline event that is also in black"},
    }}
    \pgfmathsetmacro{\length}{3}% Zero based.

    % Loop through the array containing all events.
    \foreach \i in {0, ..., \length}{
        \pgfmathsetmacro{\year}{\ourInfo[\i][0]}% Get the left cell (year)
        \pgfmathsetmacro{\eventName}{\ourInfo[\i][1]}% Get the right cell (event name)
        \draw[thick,red] (0,-2*\i-2)--(0,-2*\i);% Draw vertical line
        \ifnum \i=1 % Should be in red text
          \draw(0,-2*\i-1) node[red, right, align = left]{\eventName};% Display the event name
          \draw(0,-2*\i-1) node[red, left] {\year};
        \else % Should be in black text
           \draw(0,-2*\i-1) node[right, black]{\eventName};% Display the event name
           \draw(0,-2*\i-1) node[left] {\year};% Display the year
        \fi
    }
    % Draw the bullet with the dash
    \foreach \i in {0, ..., \length}{
        \filldraw[draw = white, fill = red,thick] (0,-2*\i-1) circle (5pt);
        \draw[thick,red] (-12pt,-2*\i-1)--(0,-2*\i-1);
    }
\end{tikzpicture}
\end{frame}
\end{document}
M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26
  • Thank you very much! It works perfectly. I am a new user so will go through your code to understand it. – uselessuser May 08 '19 at 15:14
  • I have a question. My timeline has 8 items. There are currently 4 events in your code which runs smoothly. However, when I add the fifth event, the code produces the pdf file but the fifth item is not visible. What do you think I should do? @M. Al Jumaily – uselessuser May 08 '19 at 15:43
  • Yes. There is something called length which has a value of three (zero based) denotes the total number of events. Change it to x-1 if you have x events. – M. Al Jumaily May 08 '19 at 15:45
  • Thank you. It was a stupid question. I see now :) – uselessuser May 08 '19 at 15:58