14

My question concerns the "Note" below the table. This is my code:

\begin{table}
\begin{center}
\caption{ Descriptive statistics of total sample based on modified data set}\label{table:descrtotal}
\begin{footnotesize}
\begin{tabular}{l|rrr}
\hline\hline
 & \% E & n UE & n E\\ \hline
No Denomination & 0.63 & 1425 & 2470\\ 
Buddhist & 0.70 & 312 & 731\\ 
Hindu & 0.24 & 482 & 149\\ 
Muslim & 0.23 & 3993 & 1185\\ 
Orthodox & 0.51 & 1574 & 1609\\ 
Other Christian groups & 0.53 & 697 & 779\\ 
Other Denominations & 0.53 & 294 & 326\\ 
Other Muslim groups & 0.14 & 1428 & 238\\ 
Protestant & 0.55 & 1214 & 1472\\ 
Roman Catholic & 0.56 & 2031 & 2550\\ 
\hline\hline
\end{tabular}
\end{footnotesize}
\\
\tiny Note: Share of aliens employed (\% E), Number of aliens unemployed (n UE) and Number of aliens employed (n E).\\
\end{center}
\end{table}

I would like to aligne the Note such that it starts where the ligne starts and breaks where the line ends - is that possible?

2
  • Welcome to tex.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting.
    – lockstep
    Jun 5, 2011 at 21:23
  • 2
    Whatever answer you accept, use \centering instead of center.
    – lockstep
    Jun 5, 2011 at 21:31

5 Answers 5

6

Add your note as an additional row spanning all four columns via \multicolumn. Making longer texts break in tables is possible with a minipage. The downside is, however, that you have to guesstimate the width of your table (I put in 6.5cm).

\documentclass{article}
\begin{document}
\begin{table}
\centering
\caption{ Descriptive statistics of total sample based on modified data set}\label{table:descrtotal}
\footnotesize
\begin{tabular}{l|rrr}
\hline\hline
 & \% E & n UE & n E\\ \hline
No Denomination & 0.63 & 1425 & 2470\\ 
Buddhist & 0.70 & 312 & 731\\ 
Hindu & 0.24 & 482 & 149\\ 
Muslim & 0.23 & 3993 & 1185\\ 
Orthodox & 0.51 & 1574 & 1609\\ 
Other Christian groups & 0.53 & 697 & 779\\ 
Other Denominations & 0.53 & 294 & 326\\ 
Other Muslim groups & 0.14 & 1428 & 238\\ 
Protestant & 0.55 & 1214 & 1472\\ 
Roman Catholic & 0.56 & 2031 & 2550\\ 
\hline\hline
\multicolumn{4}{l}{%
  \begin{minipage}{6.5cm}%
    \tiny Note: Share of aliens employed (\% E), Number of aliens unemployed (n UE) and Number of aliens employed (n E).%
  \end{minipage}%
}\\
\end{tabular}
\end{table}
\end{document}

enter image description here


Edit: I doubt that it's good style, but you get nicer-looking spacing before the note if you add an empty line (~\\) before it:

  \begin{minipage}{6.5cm}~\\
    \tiny Note: ...

Does anybody by chance have a solution how to get the width of the table automatically for the minipage?


Edit2: Used \centering and \footnotesize, as suggested.

4
  • see my answer for the automatic width; if you need to add some vertical space it's better to say \rule{0pt}{12pt}Note (change 12pt to suit).
    – egreg
    Jun 5, 2011 at 21:57
  • @egreg: I've read up a bit on boxing and I think I understand how your autowidth works. However, I don't know how to apply it to my solution because I need \wd\tablebox for \begin{minipage}{\wd\tablebox} within the table and thus before \end{lrbox}. Compiling this results in 26 overfull/underfull boxes and no output for the table.
    – doncherry
    Jun 5, 2011 at 22:18
  • Setting the note as a \multicolumn requires to typeset twice the table: at first without the note, so you can measure the width; then with the final row. It's much easier to add the minipage after the table.
    – egreg
    Jun 5, 2011 at 22:23
  • @egreg: Ah, thanks. I didn't edit it in, though, because that'd basically leave my answer the same as yours just with a minipage instead of your parbox. As of now, I like your answer better, but maybe someone'll come up with a autowidth fix for mine. For now, thanks for the box business, this'll come in really useful in the future!
    – doncherry
    Jun 5, 2011 at 22:37
20

Yet another option, which doesn't use explicit \parboxes or minipages, would be to use the threeparttable package (the para and flushleft options give the desired placement):

\documentclass[a4paper]{article}
\usepackage{booktabs}
\usepackage{threeparttable}

\begin{document}

\begin{table}
  \centering\footnotesize
  \caption{Descriptive statistics of total sample based on modified data set}
  \label{table:descrtotal}\medskip
  \begin{threeparttable}
  \begin{tabular}{lrrr}
    \toprule
    & \% E & n UE & n E \\
    \midrule
    No Denomination & 0.63 & 1425 & 2470 \\ 
    Buddhist & 0.70 & 312 & 731 \\ 
    Hindu & 0.24 & 482 & 149 \\ 
    Muslim & 0.23 & 3993 & 1185 \\ 
    Orthodox & 0.51 & 1574 & 1609 \\ 
    Other Christian groups & 0.53 & 697 & 779 \\ 
    Other Denominations & 0.53 & 294 & 326 \\ 
    Other Muslim groups & 0.14 & 1428 & 238 \\ 
    Protestant & 0.55 & 1214 & 1472 \\ 
    Roman Catholic & 0.56 & 2031 & 2550 \\ 
    \bottomrule
  \end{tabular}
  \begin{tablenotes}[para,flushleft]
  Note: Share of aliens employed (\% E), Number of aliens unemployed (n 
UE) and Number of aliens employed (n E).
  \end{tablenotes}
  \end{threeparttable}
\end{table}

\end{document}

EDIT: moving the \caption and \label commands inside the threeparttable environment will also adjust the width of the caption to match the one of the table.

2
  • looks great if you start your footnote text with \scriptsize Sep 18, 2022 at 23:00
  • It would have been better to place the \caption and \label directives inside rather than before the threeparttable environment, as that way the caption's width would have been set to that of the tabular environment as well.
    – Mico
    Apr 2, 2023 at 4:32
11

I propose a different approach: set the table in a box, and append the note beneath it in a parbox of the same width. I've also used booktabs to make the table more pleasant

\documentclass[a4paper]{article}
\usepackage{booktabs}
\newsavebox{\tablebox}
\begin{document}
\begin{table}
\centering
\caption{Descriptive statistics of total sample based on modified data 
set}\label{table:descrtotal}
\medskip
\footnotesize
\begin{lrbox}{\tablebox}
\begin{tabular}{lrrr}
\toprule
 & \% E & n UE & n E\\
\midrule
No Denomination & 0.63 & 1425 & 2470\\ 
Buddhist & 0.70 & 312 & 731\\ 
Hindu & 0.24 & 482 & 149\\ 
Muslim & 0.23 & 3993 & 1185\\ 
Orthodox & 0.51 & 1574 & 1609\\ 
Other Christian groups & 0.53 & 697 & 779\\ 
Other Denominations & 0.53 & 294 & 326\\ 
Other Muslim groups & 0.14 & 1428 & 238\\ 
Protestant & 0.55 & 1214 & 1472\\ 
Roman Catholic & 0.56 & 2031 & 2550\\ 
\bottomrule
\end{tabular}
\end{lrbox}
\usebox{\tablebox}\\[1ex]
\parbox{\wd\tablebox}{Note: Share of aliens employed (\% E), Number of aliens unemployed (n 
UE) and Number of aliens employed (n E).}

\end{table}
\end{document}

Note that the center environment should not be used inside table (use \centering) and that the footnotesize environment does not exist. It's possible to use it, but in certain circumstances it might bite you. :-). A \tiny paragraph is very difficult to read.

3

An alternative that I like for these kind of auxiliary explanations is to

  • Encapsulate the table in a minipage.
  • Add a footnote to the first table header that expounds on the table columns.
  • Use the footmisc package so you can make each column reference that same footnote.
2

The question has been brought up again by this duplicate. A refinement of @GonzaloMedina's answer is the \note command provided by threeparttablex when loaded with the referable option*; a similar \source command too is available.

enter image description here

\documentclass{article}
\usepackage[referable]{threeparttablex}
\usepackage{booktabs}
\usepackage{lipsum}

\begin{document}

\begin{table}
    \begin{threeparttable}
        \begin{tabular}{ccc}
            a & b & c\\\toprule
            some column text & some column text & some column text\\\bottomrule
        \end{tabular}
        \begin{tablenotes}
            \footnotesize
            \note \lipsum[1]
        \end{tablenotes}
        \caption{A table.}
    \end{threeparttable}
\end{table}
\end{document}

*Note that the \note command is designed to work in threeparttable's original environment; it is not intendend to (and will not correctly) work in threeparttablex's own ThreePartTable environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .