3

I'm new in Texmaker. There is an underfull problem i could not fix after hours looking up how to do it.

Underfull \hbox (badness 10000) in paragraph at lines 46--46
[][]$\OT1/cmtt/m/n/10 http : / / www . msal . gob . ar / chagas / index . php /
informacion -[] para -[] ciudadanos / el -[] chagas -[]
[]

Here is the Minimal Working Example (MWE)

\documentclass[12pt,twoside]{report}
\usepackage[headheight=18pt,a4paper, width=150mm, 
  height=12cm, % just for this example
  %vmargin=25mm, 
  bindingoffset=6mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength\parskip{1em plus 10pt minus 2pt} 
\usepackage[hyphens]{url}
\usepackage{titlesec}

\begin{document}

\tableofcontents

\chapter{Introducción}
bbbbbbbbbb
\section{Panorama en América Latina y en la Argentina}

Estimaciones de casos de la Organización Panamericana de la Salud (OPS, 2006) indican que en Argentina habría  7.300.000 personas expuestas, 1.600.000 infectadas y más de 300.000 afectadas por cardiopatías de origen chagásico \footnote{\url{http://www.msal.gob.ar/chagas/index.php/informacion-para-ciudadanos/el-chagas-en-el-pais-y-america-latina}}.

\end{document}

Any help?

Schweinebacke
  • 26,336

1 Answers1

3

The "underfull hbox" warning is nothing much to worry about. Given the characteristics of the URL string, LaTeX simply can't find a line break in the long URL string that wouldn't cause either a short line (and an "underfull hbox" warning) or an overfull line (with a more severe "overfull hbox" warning). Given the situation, LaTeX prefers the former.

Your readers may not even notice that an URL string in one of the footnotes contains a line break before the full width of the text block was reached. I can't imagine, though, that anyone will be bothered, let alone be distracted, by the underfull footnote line.

enter image description here

\documentclass[12pt,twoside]{report}
\usepackage[headheight=18pt,a4paper, width=150mm, 
  height=12cm, % just for this example
  %vmargin=25mm, 
  bindingoffset=6mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength\parskip{1em plus 10pt minus 2pt} 
\usepackage[hyphens]{url}
\usepackage{titlesec}

\begin{document}

\chapter{Introducción}
\section{Panorama en América Latina y \dots}

Estimaciones de casos de la Organización Panamericana de la Salud (OPS, 2006) \dots\ de origen chagásico.\footnote{\url{http://www.msal.gob.ar/chagas/index.php/informacion-para-ciudadanos/el-chagas-en-el-pais-y-america-latina}}

\smallskip\hrule % just to illustrate width of text block

\end{document}

Update, May 2020: In the time since I posted this answer nearly three years ago, the xurl package has been released. The xurl package, unlike the url package used in the answer shown above, allows line-breaks at arbitrary points in long URL strings. Simply replacing \usepackage[hyphens]{url} in the code used to produce the screenshot shown above yields the following result:

enter image description here

Mico
  • 506,678
  • A search for "underfull url" on this site will get you some suggestions, but in this case you really should not bother about it. – nplatis May 30 '17 at 04:38
  • What was annoying for me, was the blue warning. Should i get used of it? And so, this kind of "problems" are fixed always by hand or just let them be? – HernanProust May 30 '17 at 04:44
  • I changed for what you wrote but the error persistis. Can it be? (i thought it was fixed so i accepted the answer..) – HernanProust May 30 '17 at 04:50
  • An option is provided here : https://tex.stackexchange.com/questions/339682/how-to-really-solve-the-problem-of-underfull-hbox-when-typesetting-url-in-f – Michael Baudin May 08 '20 at 13:57
  • @MichaelBaudin - I think a much better option would be load the xurl package instead of the url package, i.e., to replace \usepackage[hyphens]{url} with \usepackage{xurl}. Note that the xurl package is of fairly recent vintage and didn't exist yet when I wrote the answer shown above. The xurl package alllows long URL strings to be broken anywhere. – Mico May 08 '20 at 15:12