Description
This is a LaTeX code that creates a timeline diagram using TikZ library. It starts with defining the document class as "standalone" with a font size of 6pt, and loading the TikZ and fullpage packages.
Then, a TikZ picture environment is started, which draws a horizontal line and vertical lines at specific points on the x-axis. The nodes, which are rectangular shapes containing text, are drawn at the bottom of the diagram for each event on the timeline. The nodes are aligned at the bottom of the diagram, with a text width of up to 100pt, and an above or below label that specifies the date of the event. The text of the first and last nodes is bolded, highlighting the beginning and end of the timeline.
Finally, the picture is closed, and the code finishes with the end of the document.
Keywords
TikZ, standalone, library, fullpage, nodes, horizontal line, vertical lines, text, alignment, dates.
Source Code
\documentclass[6pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usepackage{fullpage}
\begin{document}
%
%\begin{figure}
%\caption{Time Line}
%\centering
%\resizebox{\linewidth}{!}{% Resize table to fit within
\begin{tikzpicture}[]
%draw horizontal line
\draw (0,0) -- (41/1.7,0);
%draw vertical lines
\foreach \x in {0, 8, 15, 22, 29, 36, 41}{
\draw (\x/1.7,3pt) -- (\x/1.7,-3pt);
}
%draw nodes
\draw (0,0) node[text width = 85pt,align=center,below=3pt] {\textbf{Submit Project Proposal}} node[above=3pt] {Nov 17 2017};
\draw (8/1.7,0) node[below=3pt] {Find Game Engine} node[above=3pt] {Nov 20 2017};
\draw (15/1.7,0) node[text width = 100pt,align=center,below=3pt] {Create Server-Client Architecture} node[above=3pt] {Nov 25 2017};
\draw (22/1.7,0) node[text width = 100pt,align=center,below=3pt] {Implement Game Logic} node[above=3pt] {Nov 29 2017};
\draw (29/1.7,0) node[text width = 100pt,align=center,below=3pt] {Add Music and Effects} node[above=3pt] {Dec 1 2017};
\draw (36/1.7,0) node[text width = 100pt,align=center,below=3pt] {\textbf{In Class Demo}} node[above=3pt] {Dec 2 2017};
\draw (41/1.7,0) node[below=3pt] {\textbf{Finish Report}} node[above=3pt] {Dec 12 2017};
\end{tikzpicture}
%}
%\label{fig:time_line}
%\end{figure}
\end{document}