[Tex/LaTex] Text ‘stretched’ in a table

tables

I have a minor problem, although I'm unsure how to fix it. The two tables below show the tables as they appear in my thesis:

enter image description here

As you can see the space between the words 'Each' and 'successive' is too much. However when I try to replicate the problem with a MWE, the problem does not appear:

enter image description here

What could be causing the stretched words? I have other packages loaded in my main thesis document, but I don't think they are relevant to this problem.

My MWE is the following:

\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\Centering\arraybackslash}p{#1}}
\begin{document}
\begin{table}[htbp]
\centering
\renewcommand\arraystretch{1.2}
\begin{threeparttable}
\caption{Course Load of a Representative EBE student}
\label{table:eng}
\begin{tabular}{@{}p{0.20\textwidth}*{3}{L{\dimexpr0.25\textwidth-2\tabcolsep\relax}}@{}}
\toprule
& \multicolumn{3}{c}{\bfseries Cumulative Number of Prescribed Credits}
\\
\cmidrule(l){2-4}
& BSc (Eng)& ASPECT & BSc (Geomatics) \\
\midrule
First-year & \multicolumn{1}{c}{144 -- 148} & \multicolumn{1}{c}{104 -- 116} &       \multicolumn{1}{c}{142 -- 144} \\
Each successive \hbox{two-year} period\tnote{1} & \multicolumn{1}{c}{264 -- 294} &    \multicolumn{1}{c}{232 -- 248} & \multicolumn{1}{c}{296 -- 330} \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}

Best Answer

The three first columns are set justified, and there is no hyphenation. You will find the same stretching if you change the type size to \small in your MWE. So probably you have a smaller point size for the tables in your document than in the MWE.

Change the first (or the three first) column(s) to ragged right by using the new column type L that you have defined, i.e. :

\begin{tabular}{@{}L{0.20\textwidth}*{3}{L{\dimexpr0.25\textwidth-2\tabcolsep\relax}}@{}}

instead of

\begin{tabular}{@{}p{0.20\textwidth}*{3}{L{\dimexpr0.25\textwidth-2\tabcolsep\relax}}@{}}

In my opinion, ragged right is better for this type of tables. Only if you have a column with lot of text, you may consider to set it justified, but then you often have to enforce manual hyphenation. And of course LaRiFaRi recommendation of using microtypeis good, but will not solve this particular problem.

In your definition of the centred column, you have used \Centeringwith capital C, change that to \centering. If you change the last column to a C column, the column names in the last three columns line up nicely. Complete MWE:

\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % < - changed
\begin{document}
\begin{table}[htbp]
\centering
\renewcommand\arraystretch{1.2}
\begin{threeparttable}
\small                     % < - to demonstrate stratching if justified first column
\caption{Course Load of a Representative EBE student}
\label{table:eng}
\begin{tabular}{@{}L{0.20\textwidth}*{3}{C{\dimexpr0.25\textwidth-2\tabcolsep\relax}}@{}}
% Change the column type to L and C
\toprule
& \multicolumn{3}{c}{\bfseries Cumulative Number of Prescribed Credits}
\\
\cmidrule(l){2-4}
& BSc (Eng)& ASPECT & BSc (Geomatics) \\
\midrule
First-year & \multicolumn{1}{c}{144 -- 148} & \multicolumn{1}{c}{104 -- 116} &       \multicolumn{1}{c}{142 -- 144} \\
Each successive \hbox{two-year} period\tnote{1} & \multicolumn{1}{c}{264 -- 294} &    \multicolumn{1}{c}{232 -- 248} & \multicolumn{1}{c}{296 -- 330} \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}

MWE-example