Add a prefix to your labels

To keep track of (the target of) your labels you might want to add a prefix to their names indicating the thing they are referring to. E.g. sec for sections, eq for equations, fig for figures etc. It is common to separate the prefix with a colon from the label name like in the following example:

Then when you read your code you always know that \ref{sec:test} refers to a section.

In some cases the colon can cause troubles, e.g. when you type a french document with babel, varioref, hyperref and cleveref (see this and this post on TeX.SX for example). In that case you may use another character to separate the prefix.

scrpage2 is obsolete

With KOMA-Script version 3.12 the bundled package scrpage2 became obsolete and should no longer be used. Instead use the new package scrlayer-scrpage, which provides nearly the same interface but has much more power than scrpage2. For example with the new package instead of

you can use

to set the same mark content for plain and normal style pages. That is shorter and is more consistent: For instance if you have a more complex definition than \pagemark now there’s only one place to make changes.

For more details check the manual: scrguien.pdf (or the german version scrguide.pdf), chapter 5.

When changing font size don’t forget the \par

When you change the font size with commands like \Large inside a group you must end the paragraph either with a blank line or  \par before the group ends to get the right line spacing.

TeX always uses the baseline skip settings of the site active at the paragraph end, which is actually \normalsize in the first code.

Download a complete example from my website …

Paragraphs – the right way

in LaTeX the only two regular ways to end a paragraph are an empty line or the \par macro. Thus

and

is basically the same.

Please do not use \\, \newline or anything else to “end” a paragraph; it is considered to be bad style and actually wrong: From LaTeX’s point of view this only ends the line but belongs to the same paragraph. Therefore the indention or skip between paragraphs can’t work properly.

Prefer \emph over \textit

To highlight text don’t use \textit but \emph, because the latter also provides the right logical markup (“emphasize”) and takes care of nesting.

Forget about \bf and the like

Did you know that \bf, \it, \rm, \sc etc. are deprecated and should not be used with LaTeX? They don’t allow to be combined and therefore it is recommended to use the new commands like \bfseries, \itshape etc. For short text to be formatted there are also the \textXX{text} versions: