4

Question

How do I avoid the warning

Overfull \hbox (10.95003pt too wide) in paragraph at lines [...]

produced by the following document?

\documentclass[parskip=half]{scrartcl}

\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{blindtext}

\begin{document}

\blindtext

%\begin{center}
\begin{tabularx}{\textwidth}{XX}
  \toprule
  Test  & Test
  \\\bottomrule
\end{tabularx}
%\end{center}

\blindtext

\end{document}

The output looks okay:

output

Explanation

From the KOMA script manual scrguide.pdf:

half Absätze werden durch einen vertikalen Abstand von einer halben Zeile gekennzeichnet. Absatzenden durch einen Leerraum von mind. ein Geviert (1em) der normalen Schrift am Ende gekennzeichnet.

Using \textwidth contradicts this, hence the warning.

half- Absätze werden durch einen vertikalen Abstand von einer halben Zeile gekennzeichnet. Absatzenden werden nicht gekennzeichnet.

This avoids the warning.

Using center environment

Wrapping the tabularx in \begin{center}...\end{center} seems to work. Why? And is this a good idea? How do I avoid the additional vertical spacing?

Answer:

As egreg explained, in the center environment, \parfillskip is set to zero.

Other ideas

The usual suggestion of adding \noindent has no effect. There is no indentation when using parskip=half. (The problem is at the end of the line, see the answers.)

Writing {.97\textwidth} is of course not a solution.

Using {@{}XX@{}} does not get rid of the warning.

  • Try adjusting with \textwidth-2\tabcolsep. \showthe\tabcolsep yields \tabcolsep=6pt which is sufficient for your use case. Not sure if it's a best practice. – 1010011010 Jun 11 '14 at 20:12
3

The parskip=half option sets a parfillskip with a nonzero natural width (precisely to one em). It does so in order to avoid that a paragraph ends flush with the right margin, but, of course, this disallows an object fills a line by itself.

The correct way of solving this is not using a nonzero parskip under any circumstance, except, perhaps, business letters. Of course this recommendation reflects my opinion, that, however, I share with several great typographers.

If you really want to use this abominable ;-) typesetting style, just locally set \parfillskip to zero:

\documentclass[draft,parskip=half]{scrartcl}

\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{blindtext}

\begin{document}

\blindtext

\begin{tabularx}{\textwidth}{XX}
  \toprule
  Test  & Test
  \\\bottomrule
\end{tabularx}{\parfillskip=0pt\par}

\blindtext

\end{document}
  • Thanks for this explanation and the "local" fix. I still do not understand why the center environment, which uses the same parskip, also removes the warning. – One Jun 11 '14 at 20:53
  • @Thomas In the center environment, \parfillskip is set to zero. – egreg Jun 11 '14 at 20:54
  • This seems to be a good idea. Thanks again. – One Jun 11 '14 at 21:03
2

use half- (minus!):

\documentclass[parskip=half-]{scrartcl}

See the documentation for the meaning of half-, half, half+, and half*

  • Of course, thank you! Definitely the shortest correct answer giving the reason for the problem and a way to fix it. One has to change a global option, but in my case, this is not a problem. Note that - is a hyphen. – One Jun 11 '14 at 20:51
  • Your global option half is wrong, if you do not want a space of 1em at the end of a paragraph. – user2478 Jun 11 '14 at 21:06
  • You are of course right. One might or might not want to have this space at the end of paragraphs. At the end of tabularx-"paragraphs", I do not want it. As you suggested, half- removes all warnings in a clean KOMA-ish way. – One Jun 11 '14 at 21:24
  • @Thomas Well, you can always set this option “locally”. – Manuel Jun 12 '14 at 14:10

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.