3

I'm trying to create tables with small font size text in cells and large space between rows.

If I put \small in every cell, the command

\renewcommand{\arraystretch}{1.3}

works, but if I try to put \small for all the table, it doesn't work anymore.

Is there a way to set small font size once for all the cells keeping the large space between rows?

Here is the MWE:

\documentclass[11pt,openright]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagenumbering{gobble}
\usepackage[british,english]{babel}

\usepackage{tabulary}
\usepackage[flushleft]{threeparttable}
\renewcommand{\arraystretch}{1.3}
\usepackage{booktabs}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=period,format=hang,indention=0cm]{caption}
\captionsetup[table]{position=above, belowskip=4pt}

\begin{document}

%table with \small for all the table
\begin{table}[!h]
    \centering 
    \begin{threeparttable}[b]
        \caption{Table with \textbackslash{}small set once for all the cells}
        \small
            \begin{tabular}{@{}ll@{}}
                \toprule 
                \addlinespace
                        & Capital Elements\\
                \addlinespace
                \midrule
                Tier 1  & Paid-up share capital/common stock \\
                        & Disclosed reserves \\
                \addlinespace
                Tier 2  & Undisclosed reserves \\
                        & Asset revaluation reserves \\
                        & General provision/general loan-loss reserves \\
                        & Hybrid (debt/equity) capital instruments \\
                        & Subordinated debt \\
                \bottomrule
            \end{tabular}
        \par        
        \begin{tablenotes}[para,flushleft]
            \footnotesize{}\emph{Source}: BCBS (1988).
        \end{tablenotes}
    \end{threeparttable}
\end{table}

%table with \small at every cell            
\begin{table}[!h]
    \centering 
    \begin{threeparttable}[b]
        \caption{Table with \textbackslash{}small set at every cell}
        \begin{tabular}{@{}ll@{}}
        \toprule 
        \addlinespace
                            & {\small{}Capital Elements}\\
        \addlinespace
        \midrule
        {\small{}Tier 1}    & {\small{}Paid-up share capital/common stock}\\
                            & {\small{}Disclosed reserves}\\
        \addlinespace
        {\small{}Tier 2}    & {\small{}Undisclosed reserves}\\
                            & {\small{}Asset revaluation reserves}\\
                            & {\small{}General provision/general loan-loss reserves}\\
                            & {\small{}Hybrid (debt/equity) capital instruments}\\
                            & {\small{}Subordinated debt}\\
        \bottomrule
        \end{tabular}
        \begin{tablenotes}[para,flushleft]
            \footnotesize{}\emph{Source}: BCBS (1988).
        \end{tablenotes}
    \end{threeparttable}
\end{table}

\end{document}

And the output:

enter image description here

  • 1
    Your conclusion is wrong. Stretching works in both cases, however starting point is different. At common \small is considered line spacing (baseline) for small size font , at local placing of \small stretching still consider normal size fonts. So the baseline is higher as in the first case. – Zarko May 20 '16 at 20:25
  • 1
    By the way, it is not necessary to encase the contents of each cell for which \small is in effect locally in curly braces: As the scope of \small is the cell itself, you could write \small Tier 1 instead of {\small{}Tier 1} -- less code clutter, right? – Mico May 20 '16 at 21:13
  • Thank you, @Mico: I've copied the code from the source exported by LyX, that's way it so complicated! – CarLaTeX May 21 '16 at 4:49
2

That is normal: the result of \arraystretch depends on \baselineskip, which depends on the font size.

Instead of playing with \arraystretch you can load the cellspace package which defines minimal vertical spacing between a cell and the above and below cells.

\documentclass[11pt,openright]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagenumbering{gobble}
\usepackage[british,english]{babel}

\usepackage{tabulary}
\usepackage[flushleft]{threeparttable}
\usepackage{booktabs}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=period,format=hang,indention=0cm]{caption}
\captionsetup[table]{position=above, belowskip=4pt}
\usepackage{cellspace}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}

 \begin{document}

%table with \small for all the table
\begin{table}[!h]
    \centering
    \begin{threeparttable}[b]
        \caption{Table with \textbackslash{}footnotesize set once for all the cells and \textbackslash{}arraystretch = 1}
        \small
            \begin{tabular}{@{}SlSl@{}}
                \toprule
                \addlinespace
                        & Capital Elements\\
                \addlinespace
                \midrule
                Tier 1 & Paid-up share capital/common stock \\
                        & Disclosed reserves \\
                \addlinespace
                Tier 2 & Undisclosed reserves \\
                        & Asset revaluation reserves \\
                        & General provision/general loan-loss reserves \\
                        & Hybrid (debt/equity) capital instruments \\
                        & Subordinated debt \\
                \bottomrule
            \end{tabular}
        \par
        \begin{tablenotes}[para,flushleft]
            \footnotesize{}\emph{Source}: BCBS (1988).
        \end{tablenotes}
    \end{threeparttable}
\end{table}

%table with \small at every cell
\begin{table}[!h]
    \centering
\renewcommand{\arraystretch}{1.3}
    \begin{threeparttable}[b]
        \caption{Table with \textbackslash{}small set at every cell and\\\textbackslash{}arraystretch = 1.3}
        \begin{tabular}{@{}ll@{}}
        \toprule
        \addlinespace
                            & {\small{}Capital Elements}\\
        \addlinespace
        \midrule
        {\small{}Tier 1} & {\small{}Paid-up share capital/common stock}\\
                            & {\small{}Disclosed reserves}\\
        \addlinespace
        {\small{}Tier 2} & {\small{}Undisclosed reserves}\\
                            & {\small{}Asset revaluation reserves}\\
                            & {\small{}General provision/general loan-loss reserves}\\
                            & {\small{}Hybrid (debt/equity) capital instruments}\\
                            & {\small{}Subordinated debt}\\
        \bottomrule
        \end{tabular}
        \begin{tablenotes}[para,flushleft]
            \footnotesize{}\emph{Source}: BCBS (1988).
        \end{tablenotes}
    \end{threeparttable}
\end{table}

\end{document} 

enter image description here

2

As @Zarko and @Bernard have already pointed out, setting \small at the start of each cell is not the same as having \small apply to the entire row of a tabular environment: even though the cell contents will be typeset at the same size, the values of \baselineskip will differ. Specifically, given that the main font size of your document is 11pt, the value of \baselineskip is 13.6pt if \normalsize is in effect, while it is 12pt if \small is in effect.

Is there a way to set \small font size once for all cells keeping the large space between rows?

To make up for the difference in \baselineskip, you could increase the value of \arraystretch by a factor of 13.6/12=1.1333 for the table in which \small is in effect globally, i.e., set \arraystretch to 1.4733 for that table. The following screenshot shows that this is the correct adjustment amount. (Note that I've used >{\small}l as the column definition for the table on the right, saving me from having to type \small at the start of each and every cell.)

enter image description here

\documentclass[11pt,openright]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\pagenumbering{gobble}
\usepackage[british,english]{babel}

\usepackage{booktabs,array}
\usepackage[margin=10pt,font=small,
            labelfont=bf,labelsep=period,
            format=hang,indention=0cm]{caption}
\captionsetup[table]{position=above, belowskip=4pt}

\newcommand\tabinterior[1]{% table interior is common to both tables
\toprule 
\addlinespace
\multicolumn{2}{@{}l}{#1}\\
\addlinespace
\midrule
Tier 1  & Paid-up share capital \\
        & Disclosed reserves \\
\addlinespace
Tier 2  & Undisclosed reserves \\
        & Asset revaluation reserves \\
        & General provision/general \\
        & Hybrid (debt/equity) capital \\
        & Subordinated debt \\
\bottomrule}
\begin{document}


\begin{table}[!h]
\small
\renewcommand{\arraystretch}{1.4733}
\begin{tabular}[t]{@{} ll @{}}
\tabinterior{\textbackslash small global for entire table}
\end{tabular}
\normalsize % back to '11pt' as the main font size
\renewcommand{\arraystretch}{1.3} 
\begin{tabular}[t]{@{} *{2}{>{\small}l} @{}}
\tabinterior{\textbackslash small local to each cell}
\end{tabular}
\end{table}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.