2

I have multiple tables which look like this:

\begin{tabularx}{\textwidth}{|l|X|l|}
\hline
\textbf{ID} & \textbf{Description} \\ \hline
336858 & The description \\ \hline
\end{tabularx}

and I get for each one the warning:

Overfull \hbox (15.0pt too wide) in paragraph at lines X -- Y[][]

As I understand this mean something in my table don't use enough space. Or according my search when I use explicit spacing.

And thats the part I don't understand, because the Idea of {|l|X|l|} is that it use 100% width of the Document. And the output is expected.

What did I miss or misunderstand? Why did I get this warning?

minimal example

\documentclass[a4paper,10pt]{article}

\usepackage{tabularx}

\usepackage[utf8]{inputenc}
\usepackage[top=7em, bottom=4em, left=5em, right=5em]{geometry}
\usepackage{xcolor,colortbl}

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\setcounter{section}{-1}

\title{Test}
\author{test author}

\begin{document}

\maketitle
\tableofcontents

\begin{tabularx}{\textwidth}{|l|X|l|}
\hline
\textbf{ID} & \textbf{Description} \\ \hline
336858 & The description \\ \hline
\end{tabularx}

\end{document}

I use pdflatex to build.

$pdflatex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.46; using libpng 1.2.46
Compiled with zlib 1.2.3.4; using zlib 1.2.3.4
Compiled with poppler version 0.18.2
  • 1
    First of all it is a warning, not an error. Secondly, always provide a minimal example we can copy and paste. We do not know your preamble or other packages. – daleif Aug 21 '14 at 12:44
  • @daleif thanks for pointing these things out – Sir l33tname Aug 21 '14 at 12:57
  • 3
    (1) you need to compile a few times for tabularx to stabilize. (2) When I do that the only thing I get is an overfull \hbox of 15pt which is exactly the paragraph indentation. Try adding \noindent or place the table inside the center env – daleif Aug 21 '14 at 12:57
  • 1
    @daleif Adding \noindent seems to be the correct answer. Would you care to make one? :) – yo' Aug 21 '14 at 12:58
  • 1
    @Sirl33tname Your example isn't an example of the problem described in the question: It does not generate the underfull box warning in the title. It generates an unrelated overfull box warning (addressed by daleif's answer) . Please either edit the example to match the question or edit the question to match the example. – David Carlisle Aug 21 '14 at 13:15
9
  1. Please upgrade your LaTeX installation. That is one horribly old LaTeX installation
  2. In my system (TeX Live 2014), then the only warning I get is a overfull \hbox (15.0pt too wide). 15pt is the standard size of the paragraph indentation. So you may want to use

    \noindent
    \begin{tabularx}...
    

    or

    \begin{center}
    \begin{tabularx}....
    ...
    \end{tabularx}
    \end{center}
    
1

\noindent command is the correct answer. Overfull \hbox (15.0pt too wide) is a warning only. After applying \noindent command before starting \begin{tabularx} command your code runs perfectly well. I got zero error, zero warnings and zero bad boxes. However, I am working with MikTex 2.9 in windows 8.

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.