\( \renewcommand\vec[1]{\mathbf #1} \newcommand\pp[2]{\frac{\partial #1}{\partial #2}} \newcommand\dd[2]{\frac{\mathrm d #1}{\mathrm d #2}} \newcommand\d{\,\mathrm d} \)

花花花 SuperLaserNino 花花花

home · about · archive · RSS


Created: 02 Jun 2015

Modified: 13 Mar 2016

2411 words

I have helped typeset three theses and many shorter documents in LaTeX and I realized that I find myself googling the same things over and over again. Therefore I decided to collect all the problems I have solved so far on this page. At the bottom there is a list of unsolved problems. The reader is invited to give me advice in the comments.

I will update this page when I learn new things.

This page is meant mostly as a reference for myself or others, for how to solve certain problems, technically. There won’t be much discussion of why you should do something a particular way. If you want to know more about that, I suggest you start with Practical Typography and if you’re still interested in typography after that, you can move on to The Elements of Typographic Style or something.

Standard packages for every document

\usepackage[a4paper, left=4.5cm, right=4.5cm, top=3cm, bottom=4.5cm, marginparwidth=4cm]{geometry}

You probably know what most of these do. The geometry settings used here work well for symmetrical layouts. For asymmetrical layouts I like to use 2cm/6cm for inner/outer. That way I can put footnotes and pictures in the margins.



Apart from the standard packages above, the microtype package is the single most important package in existence and should be included in every document. It does a number of things:


I don’t have a huge problem with Computer Modern, but (1) it is overused, and (2) since it’s the default, most typographic sins are committed with Computer Modern, so I sometimes get a bad feeling about it (like with Times).

These are some acceptable fonts:



Palatino is like the Times New Roman of pretty fonts. It’s like everyone who’s unsatisfied with Times goes through their system fonts and says, “oh, that looks fancy!” and chooses Palatino. This means it comes close to being overused, but it still looks good enough that you can use it without feeling bad. Also, the mathpazo package offers real small caps (sc), oldstyle numerals (osf), and most of the mathematical symbols you will ever need.

It also works well with Euler math if you’re into that kind of thing.


The Johannes Kepler Project


I’ve not used this font yet but, apart from the capital T, I like the look of it. Like Palatino, Kepler offers real oldstyle figures, real small caps, and extensive math support. There is also a sans serif version of Kepler that you might want to use in combination with the serif version, but I haven’t looked at that, so it might suck.

If you’re inclined to save ink, Kepler also has a light option.2

A note on numerals

In normal text, you want to use oldstyle figures3 (lowercase numbers). You only want to use lining figures (uppercase numbers) in combination with all caps, in mathematical expressions, or in tables. With the settings I’ve described above, Palatino and Kepler will automatically switch to lining figures in math mode. If you want to set all the numbers in a block as lining figures, you can place


for Palatino, and


for Kepler at the beginning of the block.



The default line spacing (\setstretch) is usually too narrow. For most texts, a setting of 1.1 looks good, for very math-heavy or German texts I go up to 1.14 to avoid collisions between ascenders, descenders, accented mathematical symbols, etc.

I prefer indented paragraphs to vertically spaced paragraphs. If you like vertical space between your paragraphs, set \parindent to 0; if you like indented paragraphs, set \parskip to 0. Otherwise LaTeX may add spacing between paragraphs, which will look hideous if the paragraphs are indented.


To define colors:

\definecolor{other-color}{rgb}{0.8, 0.9, 1}

To use colors:




    left & right & centered & \multicolumn{1}{c}{aligned numbers}\\\midrule{}
    1 & 2 & 3 & 4.5 \\

The S alignment option aligns numbers by their decimal point. Because the column title isn’t a number, it needs to be wrapped inside the weird \multicolumn command. The [table-format=x.y] aligns the column in a way that numbers with x digits to the left and y digits to the right of the decimal point are centered. You can omit this option if everything looks fine, but it’s useful as soon as you have different numbers of digits in each row.

If you use S, the numbers will be set in math-mode, so they will automatically be lining figures. If you use l, r, or c, you will have to declare the \fontfamily at the top of the table to get them to look right.

Colored cells

Include the package


and call


inside your table-cell. The cell coloring doesn’t go all the way to horizontal rules, making the coloring discontinuous. That looks weird when you want to have entire columns in one color. I haven’t figured out how to prevent that.

Table with colored cells.

Prettier unordered lists

\newcommand{\sbt}{\,\begin{picture}(-1,1)(-1,-3)\circle*{2.2}\end{picture}\ }

The bullet character (•) is too large. To get better looking bulleted lists, this snipped works wonders. You can manipulate the size of the circle by changing the 2.2 above to something else. If you need more than two levels in your lists, you can duplicate the last line and change \labelitemii to \labelitemiii.

Prettier ordered lists


\item Item One
\item Item Two

Make numbered lists less cluttered.

Better lists

Headers and footers

If you’re using the book document class, never ever use the default headers. I don’t know whose idea it was to make the headers ITALIC ALL CAPS, but trust me, it was a terrible idea. This setting was surprisingly difficult to change, too.


I don’t even want to look at those settings.

Example headers

You can take this as inspiration and go from there.

Chapter and section headings + spacing


\newfont{\chapterNumber}{eurb10 scaled 7000}




These settings are strongly inspired by Robert Bringhurst’s The Elements of Typographic Style. The chapter numbers are set in the Euler font.

Custom table of contents








This is in part influenced by Bringhurst and in part by common sense. Most tables of content are typeset terribly.

Title page

An example for a title page. The contents of this will depend very strongly on the specific document you’re making.

{\LARGE University Name}\\
{\large Department or something\\[2cm]}
{\huge Bachelor's Thesis\\[1cm]}
{\Large\bf Title\\[1.0cm]}
{\small Author:}\\[0.2cm] {\large Author}\\[0.2cm]
{\small date}\\[0.8cm] {\small Advisor:}\\[0.2cm]
{\large Advisor name}\\[0.2cm]
Advisor's employer\\[2.2cm]
{\small Address}


Regular floating figures

\caption{A normal figure.}

Sometimes you want to put a p in the position options, too.

Margin figures

\marginpar{ %
	\captionof{figure}{A margin figure.}%

For best results, use \raggedright or \RaggedRight.

Footnotes as margin notes


\renewcommand{\footnote}[1]{ %

You can call these with \footnote. If you need to move the content of the footnote up along the margin, use


Then you can call \fnhere{Footnote content} where you want the note to appear in the margin and \fnref{} where you want the reference to appear in the text. This is only for moving footnotes up. They should move down automatically, if there are other \marginpars in the way.

\raggedright makes the text left-aligned, which looks better because margins are usually too narrow for proper justified text. \RaggedRight requires the ragged2e package and will re-enable hyphenation for the left-aligned text.

Some symbols

Some symbols I sometimes forget.



This adds 1pt of separation between the letters a and b. When I have the time, I use this extensively for adding space to the insides of paretheses since they’re set too tight in most fonts. Also works in math mode.

Colored boxes

I rarely use these because I always run into problems. But it can be kinda pretty and you can probably fix the issues if your document isn’t too complex.

\definecolor{boxblue}{rgb}{0.8, 0.9, 1}

\newmdenv[innerlinewidth=0.5pt,roundcorner=2pt,backgroundcolor=boxblue, linecolor=boxblue,innerleftmargin=6mm,innerrightmargin=6mm,innertopmargin=6pt,innerbottommargin=6pt,skipabove=1ex,skipbelow=1ex]{mybox}

You use this with


Colored boxes

Prettier ellipsis


The normal \ldots{} command creates too much space between the dots and, even with french spacing turned on, the amounts of space to the left and right of the ellipsis aren’t the same, so it looks uneven. You may need to adjust the amount of \hspace, depending on the font.


Comparison between `\ldots` and `\dotdot`

Only numbering certain lines of an align environment

  1 + 2 &= a\nonumber\\
  3 + 4 &= b \cdot e^{2\tau}\nonumber\\
  6 + 1 &= c

Only the third line has a number

What I haven’t figured out yet

  1. From Practical Typography:

    Lowercase letters don’t ordinarily need letterspacing. Nor do capital letters when they appear at the beginning of a word or sentence, because they’re designed to fit correctly next to lowercase letters. But when you use capital letters together, that spacing looks too tight.

    That’s why you always add 5–12% extra letterspacing to text in all caps or small caps, particularly at small sizes.

  2. From the documentation:

    Save up your toner and the environment, use the “light” option, it’s 20% toner less!

    The metrics are the same. The display is not very good, but the print is fine if you like light fonts.

  3. I never know which word to use. “Numerals”? “Figures”? “Numbers”? And then I just end up using them all interchangeably and it’s terrible.