10

enter image description here

How do you put the "Note: preferred model for each metric bold."?

This is my work:

\begin{table}

\caption{Model selection metrics}

\begin{center}

\begin{tabular}{l c c c c c}
\hline
{} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} & {\itshape Correlation}\\
\hline \hline
Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
2-class (restricted) & 134,442 & 133,982 & 134, 503 & 134,135 & 0.2970\\
3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
3-class (unrestricted) & --- & --- & --- & --- & --- \\
4-class (restricted) & 134,088 & 133,221 & 134,203 & 133,510 & 0.3045\\
4-class (unrestricted) & --- & --- & --- & --- & --- \\
5-class (restricted) & 134,160 & 133,089 & 134,302 & 133,446 & 0.3087\\
5-class (unrestricted) & --- & --- & --- & --- & --- \\ 
\hline

\end{tabular}

\end{center}

\end{table}

How can I add the note so it can look like the thing on the picture?

1

4 Answers 4

10

Use a multicolumn

\documentclass{article}
\begin{document}
\begin{table}
\caption{Model selection metrics}
\begin{center}
\begin{tabular}{l c c c c c}
\hline
{} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} & {\itshape Correlation}\\
\hline \hline
Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
2-class (restricted) & 134,442 & 133,982 & 134,503 & 134,135 & 0.2970\\
3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
3-class (unrestricted) & --- & --- & --- & --- & --- \\
4-class (restricted) & \textbf{134,088} & 133,221 & \textbf{134,203} & 133,510 & 0.3045\\
4-class (unrestricted) & --- & --- & --- & --- & --- \\
5-class (restricted) & 134,160 & \textbf{133,089} & 134,302 & \textbf{133,446} & \textbf{0.3087}\\
5-class (unrestricted) & --- & --- & --- & --- & --- \\ 
\hline
\multicolumn{6}{c}{\footnotesize Note: preferred model for each metric in \textbf{bold}.}
\end{tabular}
\end{center}
\end{table}
\end{document}

Result

enter image description here

6

While skpblack has shown you how to do it as you wanted, this is an attempt to show you other ways of doing it. I have used threeparttable package which provides the tablenotes facility for notes. I have also used booktabs package for its \toprule etc over \hline.

\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\begin{document}
  \begin{table}[htb]
    \begin{threeparttable}
      \caption{Model selection metrics}
       \centering  %% use this instead of \begin{center}
        \begin{tabular}{l c c c c c}
          \toprule
          {} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} &
             {\itshape Correlation}\\\toprule[1pt]
          Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
          2-class (restricted) & 134,442 & 133,982 & 134, 503 & 134,135 & 0.2970\\
          3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
          3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
          3-class (unrestricted) & --- & --- & --- & --- & --- \\
          4-class (restricted) & 134,088 & 133,221 & 134,203 & 133,510 & 0.3045\\
          4-class (unrestricted) & --- & --- & --- & --- & --- \\
          5-class (restricted) & 134,160 & 133,089 & 134,302 & 133,446 & 0.3087\\
          5-class (unrestricted) & --- & --- & --- & --- & --- \\
          \bottomrule
        \end{tabular}
        \begin{tablenotes}
          %\footnotesize   %% If you want them smaller like foot notes
          \item[a] Note: preferred model for each metric \textbf{bold}.
        \end{tablenotes}
    \end{threeparttable}
  \end{table}
\end{document}

enter image description here

It is advisable to use the switch form \centering over the environment form \begin{center} (which leaves extra vertical space).

1
  • You should add loading eithercaption or \topcapt` in order to swap the values of \abovecaptionskip and \belowcaptionskip and have a coorect verticakl spacing between caption and table.
    – Bernard
    Commented Aug 16, 2014 at 9:27
6

The following answer isn't about the main topic of your posting, as it has already been answered by @skpblack. Instead, it's about a different aspect of typesetting a table with numbers in a typographically pleasing way: Which bold font face to use?

When typesetting columns of numerical data, in which some numbers are to be rendered in the regular-weight font and the rest in a bold-weight font, it's helfpul to use a font that isn't "extended", i.e., in which characters take up the same width as in the regular (i.e., non-bold) font weight. If that's not done, numbers set in a bold-extended font face risk "sticking out" way too much and thus impairing the overall appearance of the table.

By default, LaTeX does use a "bold-extended" (bx) font face of the Computer/Latin Modern font family, for both text and math material that is to be typeset in bold. While the look that results from the use of the bold-extended font face is quite desirable for many math-mode applications, I claim that it's less than fully satisfactory when used in a tabular setting to typeset selected numbers in bold.

Fortunately, the Computer/Latin Modern family provides a "non-extended" bold font face as well, and it's straightforward to create a macro that typesets its argument in this face:

\newcommand{\ubold}[1]{\fontseries{b}\selectfont#1}

Here's an application of this macro to sample table. In all places where one would write \textbf{...} one simply writes \ubold{...}. (Note also the use of \multicolumn{6}{c}{\footnotesize ...} to typeset the table note; that was the original focus of your posting...)

enter image description here

\documentclass{article}
%% Macro to set material in "unexpanded bold" font
\newcommand{\ubold}[1]{\fontseries{b}\selectfont#1}

\begin{document}
\begin{table}
\caption{Model selection metrics}
\smallskip
\centering
\begin{tabular}{l *{5}{c}}
\hline
{} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} & {\itshape Correlation}\\
\hline \hline
Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
2-class (restricted) & 134,442 & 133,982 & 134, 503 & 134,135 & 0.2970\\
3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
3-class (unrestricted) & -- & -- & -- & -- & -- \\
4-class (restricted) & \ubold{134,088} & 133,221 & \ubold{134,203} & 133,510 & 0.3045\\
4-class (unrestricted) & -- & -- & -- & -- & -- \\
5-class (restricted) & 134,160 & \ubold{133,089} & 134,302 & \ubold{133,446} & \ubold{0.3087}\\
5-class (unrestricted) & -- & -- & -- & -- & -- \\ 
\hline
\multicolumn{6}{c}{\footnotesize Note: preferred model of each metric in \ubold{bold}.}\\
\end{tabular}
\end{table}
\end{document}
1
  • 1
    Interesting! Today learned something new
    – skpblack
    Commented Aug 16, 2014 at 8:14
0

Simply \stackunder{tabular content}{text}. If the text is more than a line, it can be incorporated into a \parbox, as shown in my 2nd MWE.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\begin{table}

\caption{Model selection metrics}

\begin{center}
\stackunder{
\begin{tabular}{l c c c c c}
\hline
{} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} & {\itshape Correlation}\\
\hline \hline
Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
2-class (restricted) & 134,442 & 133,982 & 134, 503 & 134,135 & 0.2970\\
3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
3-class (unrestricted) & --- & --- & --- & --- & --- \\
4-class (restricted) & 134,088 & 133,221 & 134,203 & 133,510 & 0.3045\\
4-class (unrestricted) & --- & --- & --- & --- & --- \\
5-class (restricted) & 134,160 & 133,089 & 134,302 & 133,446 & 0.3087\\
5-class (unrestricted) & --- & --- & --- & --- & --- \\ 
\hline
\end{tabular}
}{\footnotesize Note: preferred model for each metric in \textbf{bold}.}
\end{center}

\end{table}
\end{document}

enter image description here

For an extended note, place the under-text in a \parbox:

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\begin{table}

\caption{Model selection metrics}

\begin{center}
\stackunder{
\begin{tabular}{l c c c c c}
\hline
{} & {\itshape BIC} & {\itshape AIC} & {\itshape CAIC} & {\itshape HQIC} & {\itshape Correlation}\\
\hline \hline
Linear Regression & 138,210 & 138,014 & 138,236 & 138,080 & 0.2759\\
2-class (restricted) & 134,442 & 133,982 & 134, 503 & 134,135 & 0.2970\\
3-class (unrestricted) & 134,437 & 133,977 & 134,498 & 134,131 & 0.9275\\
3-class (restricted) & 134,128 & 133,464 & 134,216 & 133,685 & 0.2001\\
3-class (unrestricted) & --- & --- & --- & --- & --- \\
4-class (restricted) & 134,088 & 133,221 & 134,203 & 133,510 & 0.3045\\
4-class (unrestricted) & --- & --- & --- & --- & --- \\
5-class (restricted) & 134,160 & 133,089 & 134,302 & 133,446 & 0.3087\\
5-class (unrestricted) & --- & --- & --- & --- & --- \\ 
\hline
\end{tabular}
}{\parbox{4.6in}{
\footnotesize Note: preferred model for each metric in \textbf{bold}.
However, if my note is particularly long, I can just place the note in a parbox.}
}
\end{center}
\end{table}
\end{document}

enter image description here

You must log in to answer this question.

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