Your curriculum in LaTeX - part four
This is the fourth part of the tutorial. You can find here the third part.
In the first part we took care of the title of the resume; in the second part we organized the sections, using an appropriate style; finally, in the third part, we formatted the footer, as a container for our contact data. Now it's time to tackle the Experiences entries, the place where to display infos about our past and current employments. The entries will look like the following

For more clarity, the following picture shows the used grid

It is basically a table, with two columns. The first one is 2cm wide and the second spans for the remaining space of the table. The total width of the table is slightly less than the width of the page body width (i.e. the page width minus the margins width.)
To achieve this, we will use the tabularx environment, which is able calculate automatically the column size depending on the total width of the table. The general form of the environment is the following:
\begin{tabularx}{width}{preamble}
[... table data ...]
\end{tabularx}
The width parameter is the total length of the table, whereas the preamble is used for the column specifications. For each column in the table we can use a symbol in the preamble to specify which kind of column we want. For example, to indicate that a column should have the width automatically calculated, we have to use the “X” symbol in the preamble. So, the code
\begin{tabularx}{5cm}{XX}
[... table data ...]
\end{tabularx}
will define a table 5cm wide featuring two columns, both with an automatic width (in this case each column will be 2.5cm wide.) Among the preamble options, we can use the “p” symbol, followed by a width specification, to force a column to that width. So we could write something like that
\begin{tabularx}{5cm}{p{2cm}X}
[... table data ...]
\end{tabularx}
In this case the table will be 5cm wide, with the first column spanning for 2cm and the second column automatically adjusted. There's a lot of options one could specify in the preamble, so I suggest to read the tabularx document to become aware of all the possibilities.
The data enclosed in the environment will be formatted as a table. To specify rows and columns the symbols & and \\ has to be used. For example the following
\begin{tabularx}{5cm}{p{2cm}X}
Name & Stefano \\
Surname & Kindoblue \\
City & Amsterdam
\end{tabularx}
will generate this table:

Back to our requirements: we need to define a table wide, say, 97% of the page body width. To calculate that length we can use the latex command \linewidth, which represents the length of a line of text in the document (nota a \textwidth) I think we are pretty much done. The following code will create the desired table
\begin{tabularx}{0.97\linewidth}{p{2cm}X}
[... table data ...]
\end{tabularx}
Finally we can write our first entry in the Experiences section.
-
\documentclass[a4paper, oneside, final]{scrartcl}
-
-
\usepackage{soul}
-
\usepackage{scrpage2}
-
\usepackage{titlesec}
-
\usepackage{marvosym}
-
\usepackage{tabularx}
-
-
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\titlerule]
-
-
\pagestyle{scrheadings}
-
-
\renewcommand{\headfont}{\normalfont\rmfamily\scshape}
-
-
% add the symbols for email and phone contact data
-
\cofoot{\so{Liefdestraat, 7 - 1234LI, Amsterdam, Nederland}\\
-
\so{ {\Large\Letter} jeff@gmail.com \ {\Large\Telefon} +31 (0)6 12345678}}
-
-
\begin{document}
-
\begin{center}
-
-
\textsc{\Huge{\so{Iulius Caesar}}}
-
-
\section{Experiences}
-
-
\begin{tabularx}{0.97\linewidth}{p{2cm}X}
-
Period & August 2004 --- September 2006\\
-
Employer & Layer BV \hfill Amsterdam, The Netherlands\\
-
Job Title & J2EE Analyst programmer\\
-
Languages & J2EE\\
-
& Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.
-
\end{tabularx}
-
-
\section{Skills}
-
\section{Education}
-
\section{Publications}
-
\section{Personal Info}
-
\section{Languages}
-
\section{Interests}
-
-
\end{center}
-
\end{document}
Note the use of \hfill command, to push the “Amsterdam, The Netherlands” apart from the company name. The result will be this:

Nice. Now we need to format the first column, which should be ragged left and in small caps. To do so, we need to modify the preamble. Remember the symbols used to specify the column type? If we prefix those symbols with something like that
>{decl}
Then the decl will be put directly in front of the entry of the column. The decl can be a sequence of Latex commands, that will act on the column matter. We can write something like that:
\begin{tabularx}{0.97\linewidth}{>{\raggedleft\scshape}p{2cm}X}
[... table data ...]
\end{tabularx}
What we just did is to declare the text ragged left and small caps enabled for the first column. Let's go back to our curriculum and modify accordingly. I will also make bold some parts:
-
\documentclass[a4paper, oneside, final]{scrartcl}
-
-
\usepackage{soul}
-
\usepackage{scrpage2}
-
\usepackage{titlesec}
-
\usepackage{marvosym}
-
\usepackage{tabularx}
-
-
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\titlerule]
-
-
\pagestyle{scrheadings}
-
-
\renewcommand{\headfont}{\normalfont\rmfamily\scshape}
-
-
% add the symbols for email and phone contact data
-
\cofoot{\so{Liefdestraat, 7 - 1234LI, Amsterdam, Nederland}\\
-
\so{ {\Large\Letter} jeff@gmail.com \ {\Large\Telefon} +31 (0)6 12345678}}
-
-
\begin{document}
-
\begin{center}
-
-
\textsc{\Huge{\so{Iulius Caesar}}}
-
-
\section{Experiences}
-
-
\begin{tabularx}{0.97\linewidth}{>{\raggedleft\scshape}p{2cm}X}
-
Period & \textbf{August 2004 --- September 2006}\\
-
Employer & \textbf{Layer BV \hfill Amsterdam, The Netherlands}\\
-
Job Title & \textbf{J2EE Analyst programmer}\\
-
Languages & J2EE\\
-
& Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.
-
\end{tabularx}
-
-
\section{Skills}
-
\section{Education}
-
\section{Publications}
-
\section{Personal Info}
-
\section{Languages}
-
\section{Interests}
-
-
\end{center}
-
\end{document}
The result is the following:

To highlight the salient data of the employment entry in respect of the job description, we can use a gray background for the first four rows of the table. The colortbl package provides several commands to colorize backgrounds in tables. For example, the command
\rowcolor[gray]{.90}
set the background color to 90% gray for a given row. We can define a custom command to be used as a shortcut, in this way
\newcommand{\gray}{\rowcolor[gray]{.90}}
Now in our resume, for the first four rows of the table we can use the command \gray. But don't forget to include the colortbl package!
-
\documentclass[a4paper, oneside, final]{scrartcl}
-
-
\usepackage{soul}
-
\usepackage{scrpage2}
-
\usepackage{titlesec}
-
\usepackage{marvosym}
-
\usepackage{tabularx,colortbl}
-
-
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\titlerule]
-
-
\pagestyle{scrheadings}
-
-
\renewcommand{\headfont}{\normalfont\rmfamily\scshape}
-
-
% add the symbols for email and phone contact data
-
\cofoot{\so{Liefdestraat, 7 - 1234LI, Amsterdam, Nederland}\\
-
\so{ {\Large\Letter} jeff@gmail.com \ {\Large\Telefon} +31 (0)6 12345678}}
-
-
\begin{document}
-
\begin{center}
-
-
\textsc{\Huge{\so{Iulius Caesar}}}
-
-
\section{Experiences}
-
\newcommand{\gray}{\rowcolor[gray]{.90}}
-
\begin{tabularx}{0.97\linewidth}{>{\raggedleft\scshape}p{2cm}X}
-
\gray Period & \textbf{August 2004 --- September 2006}\\
-
\gray Employer & \textbf{Layer BV} \hfill Amsterdam, The Netherlands\\
-
\gray Job Title & \textbf{J2EE Analyst programmer}\\
-
\gray Languages & J2EE\\
-
& Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.
-
\end{tabularx}
-
-
\section{Skills}
-
\section{Education}
-
\section{Publications}
-
\section{Personal Info}
-
\section{Languages}
-
\section{Interests}
-
-
\end{center}
-
\end{document}
Finally we obtain something like this:

Sweet, isn't it? We are able to define a table for our job entries, with style (at least, in my humble opinion). Only problem is there's a lot of boilerplate code to repeat for each job entry we would like to add to our document. So in the next part of the tutorial I will show how to define a custom environment that will format once for all of our job entries, regardless their number. Along the road there will be room also for some refinements.
See you in 7 seven years, then.
Comments(32)