5 Jun 2012 hypatia   » (Journeyer)

Useful LaTeX packages: tables and figures

This is part of a short series of entries on LaTeX packages I found useful while preparing the examination copy of my PhD thesis.

Today’s entry is packages relevant to preparing tables or figures. Again, some are pretty widely known and some aren’t.


If you have a big table or figure that should be rotated sideways onto its own page:


And then you can replace the table and figure commands with:

%Giant table goes here
%Giant figure goes here


The dcolumn package produces tabular columns that are perfectly aligned on a decimal point (ie all the decimal points in that column are exactly underneath each other), which is usually how you want to display decimal numbers.

% create a new column type, d, which takes the . out of numbers, replacing the .
% with a \cdot and aligning on it.

Now that you have defined the column type, you can use d in the tabular environment, where the numeric argument is the number of figures to expect after the decimal point. You don’t have to use exactly that number of figures in every entry, just that that’s how much room it will leave.

% a tabular enviroment with a 1 and 3 figures after the decimal point column
1.6 & 1.657
2.0 & 6.563
7 & 6.26

One annoying aspect of this package is that for the headers of that column, which probably aren’t numbers, you will need to use \multicolumn to get them to display nicely.

% a tabular enviroment with a 1 and 3 figures after the decimal point column
\multicolumn{1}{c}{Heading 1} & \multicolumn{1}{c}{Heading 2}\\
1.6 & 1.657
2.0 & 6.563
7 & 6.26

You can mix the d column type with the usual l, r and p column types.


You can’t use \footnote in a floating table. This is one of several packages that allow table footnotes in various ways.


threeparttable doesn’t cause tables to float on its own, so you usually want to wrap in a table command:

% Normal bits of your table go here, and use \tnote{a} and
% \tnote{b} and so to generate a note mark
\tnote General note
\tnote General note 2
\tnote[a] Note for mark a
\tnote[b] Note for mark b
\caption{Caption goes here}

Unfortunately you need to generate the a, b, c (or whatever) numbering manually.

The general \tnote entries are useful for things like “Bold entries are highest in the column”, so that they don’t need to go in the caption.

Syndicated 2012-06-04 23:30:44 from lecta

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!