Your curriculum in LaTeX - part two
This is the second part of the tutorial. You can find here the first part.
Now it's time to add the section headers. We will use the command \section, in this way:
-
\documentclass{article}
-
-
\includepackage{soul}
-
-
\begin{document}
-
-
\begin{center}
-
-
\textsc{\so{\Huge{Iulius Caesar}}}
-
-
% hereafter we specify the section
-
% of our resume
-
\section{Experiences}
-
\section{Skills}
-
\section{Education}
-
\section{Publications}
-
\section{Personal Info}
-
\section{Languages}
-
\section{Interests}
-
-
\end{center}
-
-
\end{document}
The result is like this:

The section headers can be improved with a little bit of personality. So, instead of living with the standard format for the section header, we will customize it. The package titlesec is offering several macro to cope with personalization of titles and headers. Install it and load in the preamble, so we can use the \titleformat command
\titleformat{command}[shape]{format}{label}{sep}{before}[after]
It takes 7 parameters. The ones in curly braces are mandatory; the others, optional.
- The first parameter, command, is used to specify which sectioning command has to be redefined. In our case, we want to change the format of the sections, so we will use the value
\section - The second parameter is to specify the shape of the sectioning command. For the possible values, see the titlesec manual. In our case, we are happy with the default shape.
- The third parameter is the most important. Here we can specify the format for the entire title.
- The fourth parameter is the label. It is some text that appears in the title. In the previous image, the labels for the section are the running numbers.
- The fifth parameter is the separator between the label and the title.
- The last two parameters can contains LaTeX code that will appears before and after the title material.
So, to begin with, let's eliminate the numbers in front of the section titles, by using the following declaration
\titleformat{\section}{}{}{0em}{}
As first parameter, we specify the sectioning command whose format has to be redefined; in our case: \section. The shape parameter is not passed, because we are happy with the default value and it is not mandatory. The third parameter, the format, we leave empty for the moment. Now the forth parameter, the label. We said we want to get rid of the numbers, so we leave the parameter out. Regarding the fifth parameter, we have to specify a length for the separation between label (null) and the title. The sixth parameter also will be left empty. The seventh parameter is not specified because is not mandatory.
So our code will look like the following:
-
\documentclass{article}
-
-
\usepackage{soul}
-
\usepackage{titlesec}
-
-
% this is a global declaration that
-
% will change the appearance of
-
% the section command
-
\titleformat{\section}{}{}{0em}{}
-
-
\begin{document}
-
\begin{center}
-
-
\textsc{\Huge{\so{Iulius Caesar}}}
-
-
\section{Experiences}
-
\section{Skills}
-
\section{Education}
-
\section{Publications}
-
\section{Personal Info}
-
\section{Languages}
-
\section{Interests}
-
-
\end{center}
-
\end{document}
The section titles now become like this:

Now it's time to play with the format parameter. To begin with, I would say to increase the font size and use the small caps. After all, those strings are the labels of the sections, so we have to add some emphasis. It's easy to do, just use the commands \large\scshape in the format. So our declaration will be
\titleformat{\section}{\large\scshape}{}{0em}{}
The result is the following:

You may notice something strange: the title "Personal Info" is typeset as justified. Whatever is the reason, we can specify our titles has to be ragged on the right. So we can change the format to:
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}
Let's take a look now:

As final touch, we can add a separator line. To do so we should add the command \titlerule after each title. If you remember, the last two parameters of the \titleformat are meant to specify materials that goes before and after, respectively, the titles. The definition now becomes:
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\titlerule]
We just specified the last parameter, in a way that a title rule will be appended (after) the titles. The parameter is not mandatory, so when it appears, has to be wrapped in square braces and not in curly ones. The result is the following:

I think we are pretty much done with the section titles. Hereafter I show how their look changed along the tutorial:

For the third part, see you in seven years.
[…] is the third part of the tutorial. You can find here the second […]