home | lab | find me | science | publications | software | toolbox | site map


LaTeX tips



Creating a nice blue side note

2008-05-17
\newcommand\note[1]{\mbox{}\marginpar{\footnotesize\raggedright\hspace{0pt}\color{blue}\emph{#1}}}

Thanks to Stephan Saalfeld for sharing this tip.

Adding headers and footers

2008-07-14

The fancyhdr package lets us put that: fancy headers and footers. In this case below, I add my name to the top left, then a title to the top right, I remove the default line separating header and text (by setting its width to zero), and then I add at the bottom the page number centered (hence the C).

...
\usepackage{fancyhdr}
\usepackage{color}

...

\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0.0pt}

\definecolor{Gray}{rgb}{0.6,0.6,0.6}

\begin{document}

...

\rhead{\color{Gray}{\emph{Research Statement}}}
\lhead{\color{Gray}{Albert Cardona}}
\fancyfoot[C]{\thepage}

\end{document}

Adjusting the line separation arbitrarily

2008-07-14

Because sometimes single, 1.5 and double spacing is not the right spacing:

...
\usepackage{setspace}
...
\begin{document}

% Set line separation to 1.1 (i.e. a bit more than just one):
\setstretch{1.1}

Beware of default Computer Modern font!

2008-07-14

The Computer Modern font is perhaps the most beautiful font out there. Yet, many online file concatenators (such as those of scientific journals and institutions) have poor or no support for the ligatures (such as fi or à, etc.), which may not render at all. Thus words such as first will render as rst.

A workaround for these poorly built comercial systems is to switch to a ligature-free font that looks reasonably well, such as palatino:

...
\usepackage{palatino}
...
\begin{document}
...

Adjusting top, bottom, left and right margins

2008-07-14

For 1.5 inches top and bottom, and 1 inch left and right.

Notice I also use a 15 mm paragraph identation, and 2 mm paragraph separation.

...
\parindent 15.mm
\parskip 2.mm

\topmargin      =  0.mm         % beyond 25.mm
\oddsidemargin  =  0.mm         % beyond 25.mm
\evensidemargin =  0.mm         % beyond 25.mm
\textheight     =200.mm
\textwidth      =162.mm

...
\begin{document}
...


Last updated: 2012-05-08 11:10 Zurich time. Copyright Albert Cardona.