5

In the following (M)WE, the tabular version of the Contact information from a CV gives an overfull hbox warning when compiled with pdfLatex, but the minipage version does not. Why? I have not found a satisfactory explanation among the many questions that have been posed about overfull hboxes, but if you know the right place, please direct me there!

\documentclass[10pt,draft]{article}
\usepackage{calc}
\usepackage[paper=letterpaper,
            margin=1in,
            showframe]{geometry}
\setlength{\parindent}{0in}
\setlength\fboxsep{0pt}
\begin{document}

\newlength{\rcollength}\setlength{\rcollength}{2.1in}%
\newlength{\spacewidth}\setlength{\spacewidth}{50pt}%
\newlength{\lcollength}\setlength{\lcollength}{\textwidth-\rcollength-\spacewidth}
%
\begin{tabular}[t]{@{}p{\lcollength}@{}p{\spacewidth}@{}p{\rcollength}}%
\parbox{\lcollength}{%
Department of Mechanical Engineering\\%
University of Anywhere\\%
123 Road St.\\%
Normal, IL USA}%
&%
{\vrule width 0.5pt}
\parbox[m][4\baselineskip]{\spacewidth}{}%
&%
\parbox{\rcollength}{%
\textit{E-mail:}\\%
\textit{Work:} +1-123-456-7890 \\%
\textit{Cell:} +1-123-456-7890 \\%
\textit{Web:}%
}%
\end{tabular}%

\begin{minipage}{\lcollength}
Department of Mechanical Engineering\\%
University of Anywhere\\%
123 Road St.\\%
Normal, IL USA%
\end{minipage}%
\begin{minipage}{\spacewidth}
\rule{0.5pt}{4\baselineskip}
\end{minipage}%
\begin{minipage}{\rcollength}
\textit{E-mail:}\\%
\textit{Work:} +1-123-456-7890 \\%
\textit{Cell:} +1-123-456-7890 \\%
\textit{Web:}%
\end{minipage}

\end{document}
0

1 Answer 1

6
\begin{tabular}[t]{@{}p{\lcollength}@{}p{\spacewidth}@{}p{\rcollength}}%

you have used @{} to omit most inter-column space but you do not have @{} at the end so there is a \tabcolsep after the last column.

\begin{tabular}[t]{@{}p{\lcollength}@{}p{\spacewidth}@{}p{\rcollength}@{}}%
3
  • Thanks! Why does LaTeX put a \tabcolsep before the first column and after the last column? Or, another way, why is \tabcolsep used as the pre- and post-table spacing?
    – darthbith
    Commented Aug 15, 2013 at 22:07
  • 1
    @darthbith why hard to answer You'd have to ask Leslie if he can remember if other options were considered, LaTeX has always done this. Commented Aug 15, 2013 at 22:10
  • I have a similar question here: tex.stackexchange.com/questions/438820/… maybe you could help me too :)
    – PascalS
    Commented Jul 3, 2018 at 17:01

You must log in to answer this question.

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