Wiki » History » Version 4

« Previous - Version 4/5 (diff) - Next » - Current version
Cristovao Andre Antunes Cruz, 10/17/2013 06:59 PM

LaTeX Tips and Tricks


  • Put your files in source control.
  • If you are typesetting any math, reading Math mode by Herbert Voß is a must.
  • Typeset your document in draft mode to see how bad over- and underfull lines are, and if they are pretty bad, consider changing the wording a bit (but don't fuss too much over this, as the best wording is more important than minor typographical improvements). You can also help Latex by letting it hyphenate some words in this case.
  • Use \centering instead of \begin{center} \end{center} to center things inside tables/figures etc. \centering doesn't add any additional vertical space.
  • Use \newcommand to make things more logical.
  • If your document has a lot of technical figures, it might be a good idea to learn PGF/Tikz, sketch 3D, and pstricks, or a combination of those.
  • Select the correct size of paper (a4paper, letter, …)
  • \usepackage{flafter} to make sure the float never appear before its position in the code.
  • Use namespaces for labels, e.g., fig:somefigure, eq:someequation, tab:sometable, etc.
  • Put all the figures in the same folder, possibly in many diferent formats, and in never use the file extension in the code, the correct format will be automatically selected. In the beginning of the file do \usepackage{graphicx} \graphicspath{{./figures/}}.
  • Beware of end-of-line control characters if using multiple operating systems.
  • Be careful with the encoding and do something like \usepackage[utf8]{inputenc}
  • Run chktex to detect things that could be improved.


Interesting Packages




Warns the user about the usage of old packages or commands (for example, using \it, \tt, etc.). nag warns about the things mentioned in l2tabu (Obsolete packages and commands).


Fixes some 'mistakes' in Latex. From the description:
  • ensure one-column floats don't get ahead of two-column floats;
  • correct page headers in twocolumn documents;
  • stop spaces disappearing in moving arguments;
  • allowing \fnysmbol to use text symbols;
  • allow the first word after a float to hyphenate;
  • \emph can produce caps/small caps text;
  • bugs in \setlength and flushbottom.


Use when you have to change the interline spacing instead of changing the \baselinestretch.


En­hances the qual­ity of ta­bles in LaTeX, pro­vid­ing ex­tra com­mands as well as be­hind-the-scenes op­ti­mi­sa­tion. Guide­lines are given as to what con­sti­tutes a good ta­ble in this con­text.


The microtype package provides a LaTeX interface to the micro-typographic extensions of pdfTeX: most prominently, character protrusion and font expansion, furthermore the adjustment of interword spacing and additional kerning, as well as hyphenatable letterspacing (tracking) and the possibility to disable all or selected ligatures.

It allows to apply these features to customisable sets of fonts, and to configure all micro-typographic aspects of the fonts in a straightforward and flexible way. Settings for various fonts are provided.


If you're creating PDF documents, use hyperref to get hyperlinks in your document.


Use geometry package to set up page geometry instead of doing it manually.


Use fancyvrb to get precise control in verbatim listings.


Manipulate the table of contents look, among other things.


To type SI units.


Format numbers nicely (locale-specific, with commas as thousands separator, etc.).


The pack­age lets the user mark things to do later, in a sim­ple and vi­su­ally ap­peal­ing way. The pack­age takes sev­eral op­tions to en­able cus­tomiza­tion/fine­tun­ing of the vi­sual ap­pear­ance.


pgf/tikz produces very high quality images that fit perfectly with the whole document and workflow. Challenging to master, but the results are very good and platform independent since the images are just tikz code and are interpreted by the latex engine.


Produce high quality plots with very little effor. Supports many sorts of plots, including logarithmic and smith charts. The end result fits very nicely with a latex document.


Produce simple timing diagrams. Requires knowledge of pgf/tikz to customize diagrams and include, for example, arrows pointing to transitions. Must be included after pgfplots if both are in use.

Tools That Help



Useful Links