# Overfull problem with an url [duplicate]

When compiling a document console returns:

Overfull \hbox (10.57799pt too wide) in paragraph at lines 40--43
-[]y-[]america-[]latina\$\OT1/cmr/m/n/12 ]. Pro-
[]


MWE

\documentclass[12pt,twoside]{report}

\usepackage[utf8]{inputenc}

\usepackage{fancyhdr}
\pagestyle{fancy}

\setlength\parskip{1em plus 10pt}
\renewcommand{\footrulewidth}{0.4pt}
\usepackage{url}

\begin{document}
bla bla bla bla and
\url{http://www.msal.gob.ar/chagas/index.php/informacion-para-ciudadanos/el-chagas-en-el-pais-y-america-latina}. Programa Nacional de Chagas del Ministerio de la Nación.
\end{document}


What can I do to solve the warning?

## marked as duplicate by CarLaTeX, siracusa, CampanIgnis, Raaja, Johannes_BMay 30 at 6:10

Add option hyphens to package url to allow breaks at explicit hyphens in URLs:

\usepackage[hyphens]{url}


With more breakpoints, it is easier for TeX to break paragraphs into lines without overfull \hboxes.

Using xurl package instead of url (see here):

\documentclass[12pt,twoside]{report}

\usepackage[utf8]{inputenc}

\usepackage{fancyhdr}
\pagestyle{fancy}

\setlength\parskip{1em plus 10pt}
\renewcommand{\footrulewidth}{0.4pt}
\usepackage{xurl}

\begin{document}
bla bla bla bla and
\url{http://www.msal.gob.ar/chagas/index.php/informacion-para-ciudadanos/el-chagas-en-el-pais-y-america-latina}. Programa Nacional de Chagas del Ministerio de la Nación.
\end{document}


This actually worked for me.

It creates a box with limited width around the URL, so you can make it fit within the \textwidth of your document.

\documentclass{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}%able to do the same and even more

\begin{document}
\fbox{
\parbox{4cm}{
\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/index.html}
}}
\end{document}


The box is displayed with a black border by default.

If you want to remove the border, just add the following line before \begin{document}

\setlength{\fboxrule}{0.0pt}


NOTE @PhelypeOleinik contribution in the comments. Thanks! To remove the border you can just comment out the \fbox. Also, note that this method won't work if the url contains a #.
• To remove the border just comment out the \fbox. This will only avoid the warning, it will not improve the output... – Phelype Oleinik May 29 at 21:17
• Fine by me. However note that it won't work if the url contains a #. – Phelype Oleinik May 30 at 12:57