Generaloverfull \hbox - why?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
alex.blackbit
Posts: 13
Joined: Tue Aug 26, 2008 9:01 pm

overfull \hbox - why?

Post by alex.blackbit »

hi,

with this post, which is the my first in this forum, i would like to get some information about the overfull \hbox phenomenon.
if this is important, i use texlive, but got the same results with tetex.
when compiling the this code i get a overfull \hbox on the beginning of each new column, and i don't understand why.
actually the result looks like i excepted it.

--
maybe someone can clear things up a bit.
thanks in advance
alex

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

overfull \hbox - why?

Post by localghost »

Enable Cork Encoding to activate Type 1 (EC) fonts. Modify your preamble as follows.

Code: Select all

\documentclass[a4paper,twocolumn]{article}
\usepackage[T1]{fontenc}                   % Cork Encoding einschalten, wichtig für Silbentrennung
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[centering,includeheadfoot,margin=2cm]{geometry}
\usepackage{txfonts}
\usepackage{supertabular}
\usepackage{array}
Replace the obsolete german package by babel as shown in the code above. Think about enhancing your page layout with geometry instead of fullpage.

Perhaps a list environment would be better in this case.


Best regards and welcome to the board
Thorsten¹
alex.blackbit
Posts: 13
Joined: Tue Aug 26, 2008 9:01 pm

overfull \hbox - why?

Post by alex.blackbit »

localghost,

thank you for your suggestions.

\usepackage[T1]{fontenc} is nice.

\usepackage[ngerman]{babel} instead of \usepackage{german} too.

\usepackage[centering,includeheadfoot,margin=2cm]{geometry} instead of \usepackage{fullpage} also.

\usepackage{txfonts} instead of \usepackage{mathptmx} does not work good for me.
this way a font is embedded in the resulting pdf (dvipdf) that is not needed.


now the situation seems to be better than before, but not really satisfying, now i have overlapping text at some positions.
localghost, could you try it out yourself?
the link from my initial post points to the current version of the .tex file.

by the way, is it possible to enable word-wrapping in supertabular?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

overfull \hbox - why?

Post by localghost »

alex.blackbit wrote:[...] \usepackage{txfonts} instead of \usepackage{mathptmx} does not work good for me.
this way a font is embedded in the resulting pdf (dvipdf) that is not needed. [...]
That was only a small failure with copy and paste from one of my documents. Stay with mathptmx if that fits better.
alex.blackbit wrote:[...]now the situation seems to be better than before, but not really satisfying, now i have overlapping text at some positions.
localghost, could you try it out yourself?
the link from my initial post points to the current version of the .tex file.

by the way, is it possible to enable word-wrapping in supertabular?
You have to try something like p{...} column types to avoid overlapping and get line wrapping.

Code: Select all

\begin{supertabular}{p{0.3\linewidth}p{0.7\linewidth}}
  ...
\end{supertabular}
To avoid difficulties in hyphenation, use a special syntax at places with a divis.

Code: Select all

Aichach"=Friedberg
This only works with babel and the quotation sign as special active character.
alex.blackbit
Posts: 13
Joined: Tue Aug 26, 2008 9:01 pm

overfull \hbox - why?

Post by alex.blackbit »

localghost,

i got a usable result with margin=1cm for {geometry} and

Code: Select all

\begin{supertabular}{p{0.1\linewidth}p{0.8\linewidth}}
please note that 0.1+0.8<1.0. do you have a quick explanation why this is necessary?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

overfull \hbox - why?

Post by localghost »

alex.blackbit wrote:[...] please note that 0.1+0.8<1.0. do you have a quick explanation why this is necessary?
That's something I didn't take into account. The length \columnsep between two columns has to be subtracted. A margin of 1cm looks too narrow for me. The result should also be suitable with a 2cm margin.
Post Reply