1

Texmaker will give me a lot of warnings:

Underfull \hbox (badness xxxxx) in paragraph at lines xx--xx

My code looks like this.

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{longtable}
\usepackage[left=4cm,right=2.5cm,top=2cm,bottom=2cm,bindingoffset=6mm]{geometry}
\usepackage[ngerman]{babel} 
\selectlanguage{ngerman}

\begin{document}
\begin{center}
\begin{longtable}{|p{0.45\textwidth}|p{0.45\textwidth}|  }
\hline
Arbeitsschritte & Weitere Informationen unter \\
\endhead
\hline 
\multicolumn{2}{|p{0.9\textwidth}|}{1 Voraussetzungen schaffen} \\ 
\hline 
Wissensaufbau in der Kanzlei (bei Bedarf) & Checkliste zum erfolgreichen Einstieg in das Buchen mit digitalen Belegen \\ 
\hline 
IST-Aufnahme im Unternehmen: Prüfung und Schaffung der Einsatzvoraussetzungen für DATEV Unternehmen online für einen reibungslosen Ablauf & DATEV-Online-Anwendungen in DATEV Unternehmen online - Einsatzvoraussetzungen \\ 
\hline 
\end{longtable} 
\end{center}
\end{document}

The table looks like this:

enter image description here

In my original file the table is much longer and I will only get warnings for rows where one cell have more rows than the other one.

How can I get rid of the warnings?

Christian
  • 157
  • 1
  • Thank you for your suggestion - i've installed and used the microtype package (marked as solution in the other thread) updated my fonts database but sadly got the same errors as before. – Christian Oct 15 '19 at 18:25
  • 1
    How is this related to the use of biber? – leandriis Oct 15 '19 at 18:41
  • 1
    Also, please remove the center environment around the longtable, since longtables are automatically horizontally centered. – leandriis Oct 15 '19 at 18:42
  • 1
    The underfull box warning are caused by the table columns being justified. To overcome this and to left align the contents of the longtable instead of justifying them, you could use \begin{longtable}{|>{\raggedright\arraybackslash}p{0.45\textwidth}|>{\raggedright\arraybackslash}p{0.45\textwidth}| } and add the array package to your preamble. – leandriis Oct 15 '19 at 18:44
  • Thank you very much, it has gotten much better. I followed your instructions and now get only 1 warning "Underfull \vbox (badness 10000) detected at line 24 (thats the line "\end{longtable}"). Do you also know how i can get rid of this error?

    I think it is related to biber because the warnings only gets shown if I configure Texmaker to use biber insted of bibtex

    – Christian Oct 15 '19 at 18:57
  • @Christian: Your curent example code contains nothing that would require the use of biber so I don't really get it. What happens if you just use pdflatex to compile your code? – leandriis Oct 15 '19 at 19:07
  • Well, you're right I've tested it again and saw that the warning just got covered under an other error - sorry I've edited my main post now... – Christian Oct 15 '19 at 19:19
  • @Christian: We'd like to keep answers separate from questions, so please write a separate answer instead of editing your answer into the question. – leandriis Oct 15 '19 at 20:09

1 Answers1

0

With the help of leandriis and this solution Underfull \vbox in each longtable... can it be fixed or must it be ignored? I've finally managed to get rid of all warnings.

I've added the array package removed the \begin{center} and \end{center} lines, swapped \begin{longtable}{|p{0.45\textwidth}|p{0.45\textwidth}| } for \begin{longtable}{|>{\raggedright\arraybackslash}p{0.45\textwidth}|>{\raggedright\arraybackslash}p{0.45\textwidth}| } and moved the \hline before the \endhead.

Final code looks like this:

\documentclass[12pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{longtable}
\usepackage[left=4cm,right=2.5cm,top=2cm,bottom=2cm,bindingoffset=6mm]{geometry}
\usepackage[ngerman]{babel} 
\selectlanguage{ngerman}
\usepackage{array}

\begin{document}
\begin{longtable}{|>{\raggedright\arraybackslash}p{0.45\textwidth}|>{\raggedright\arraybackslash}p{0.45\textwidth}| }
\hline
Arbeitsschritte & Weitere Informationen unter \\
\hline
\endhead
\multicolumn{2}{|p{0.9\textwidth}|}{1 Voraussetzungen schaffen} \\ 
\hline 
Wissensaufbau in der Kanzlei (bei Bedarf) & Checkliste zum erfolgreichen Einstieg in das Buchen mit digitalen Belegen \\ 
\hline 
IST-Aufnahme im Unternehmen: Prüfung und Schaffung der Einsatzvoraussetzungen für DATEV Unternehmen online für einen reibungslosen Ablauf & DATEV-Online-Anwendungen in DATEV Unternehmen online - Einsatzvoraussetzungen \\ 
\hline 
\end{longtable} 
\end{document}
Christian
  • 157