[Tex/LaTex] Too long website as footnote results in `Overfull \hbox`

footnotesurls

I have a very long website as footnote and I get a warning message Overfull \hbox.

This is the website:

\footnote{Vgl.: http://www.bmwi.de/DE/Themen/Energie/Energiedaten-und-analysen/Energiedaten/energiegewinnung-energieverbrauch.html}

If I insert allowbreak like below, I get another warning message Underfull \hbox

\footnote{Vgl.: http://www.bmwi.de/DE/Themen/Energie/Energiedaten-und-analysen/Energiedaten/\allowbreak energiegewinnung-energieverbrauch.html}

Can someone tell me which is the best way to handle this?

Best Answer

For long URLs use:

\usepackage[hyphens]{url}
...

\footnote{\raggedright Vgl.: \url{http://www.bmwi.de/DE/Themen/Energie/Energiedaten-und-analysen/Energiedaten/energiegewinnung-energieverbrauch.html}}