This table has been causing me nothing but problems. Right now, it looks OK:
But it's clear the vertical spacing is not so good. "Region" is too high (which I tried to address with the [fixup]
parameter of multirow: [-0.5em]
). I used \parbox
to get line breaking and centering of the middle columns proper. To fit my page width these columns need to line-wrap on three lines.
When I run, I get two errors for these two columns:
Overfull \vbox (5.89192pt too high) detected
Overfull \vbox (6.57993pt too high) detected
Like I said, it looks OK, but I'd like to understand what's going on (even if I could just change table content to fix the problem, that won't tell me why it was a problem). Perhaps I'm a glutton for punishment, but after a few hours pounding away at my thesis I enjoy taking a break by debugging \LaTeX
errors/warnings.
I have read several questions/answers here and tried inserting invisible rules (from a comment), \smash
(which broke line-wrapping), \vphantom
(which made text disappear), adding [1em]
in various places of varying sizes, and several other methods.
MWE:
\documentclass{article} % The class file specifying the document structure
\usepackage{palatino} % Use the Palatino font by default
\usepackage{siunitx}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{array}
\usepackage[referable]{threeparttablex}
\usepackage{multirow}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
\geometry{
paper=letterpaper, % Change to letterpaper for US letter
inner=2.5cm, % Inner margin
outer=3.8cm, % Outer margin
bindingoffset=.5cm, % Binding offset
top=1.5cm, % Top margin
bottom=1.5cm, % Bottom margin
}
\begin{document}
\begin{table}[!htb]
\sisetup{input-decimal-markers = .,group-separator={,}, group-four-digits = true}
\captionsetup{skip=0.5\baselineskip,size=footnotesize}
\footnotesize
\centering
\begin{threeparttable}
\begin{tabular}{L{2.8cm}*4{S[table-format=2.1]}}
\toprule
\multicolumn{1}{c}{\multirow{2}{*}[-0.5em]{\parbox[c]{2.7cm}{\centering \textbf{Region}}}} &
\multicolumn{1}{c}{\multirow{2}{*}{\parbox[c]{1.8cm}{\centering \textbf{Electric outages per month}\tnote{a}}}} &
\multicolumn{1}{c}{\multirow{2}{*}{\parbox[c]{2.0cm}{\centering \textbf{Typical outage duration (hours)}\tnote{a}}}} &
\multicolumn{2}{c}{\centering\textbf{Population with electricity access}\tnote{b}} \\ \cmidrule{4-5}
& ~ & ~ & \multicolumn{1}{c}{\parbox[c]{1.7cm}{\centering \textbf{~~Total [\si{\percent}]}}} & \multicolumn{1}{c}{\parbox[c]{1.7cm}{\centering\textbf{~~Rural [\si{\percent}]}}} \\ [0.2cm]
\midrule
South Asia & 25.4 & 3.1 & 78. & 69.3 \\%
Sub-Saharan Africa & 9.0 & 4.2 & 35.3 & 15.3 \\%
OECD countries & 0.4 & 0.4 & 99.9 & 99.7 \\%
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] For commercial users only
\item[b] For residential users only
\end{tablenotes}
\end{threeparttable}
\caption[Grid statistics for selected regions]{Grid statistics for selected regions.}
\label{tab:grid}
\end{table}
\end{document}
Note that the screenshot and MWE use the article
class, but for my document I'm using a slightly modified version of the custom class MastersDoctoralThesis
(but the errors are identical either way):
\documentclass[11pt,oneside,english,singlespacing,
headsepline,chapterinoneline]
{MastersDoctoralThesis}
{article}
class and give the same errors I get when using{MastersDoctoralThesis}
.