[Tex/LaTex] Underfull \hbox (badness 10000) warning in footnote

footnotes

With this code:

Our baseline\footnote{The config can be found in the
published repository under the name
\begin{tiny}\texttt{dropout01.l2\_1e\_2.6l.n500.inpstddev3.fl2.max\_seqs100.grad\_noise03.nadam.lr05e\_3.nbm6.nbrl.grad\_clip\_inf.nbm3}\end{tiny}
.}

I get the warning Underfull \hbox (badness 10000).
I found many similar questions here with the same error message, which mostly suggest to add \hfill or something like that. But nothing like that worked for me to get rid of the warning.

What exactly is the problem? And how to I get rid of the warning?

Best Answer

You should use the url package for such objects, it knows how to break at a number of different characters already and you won't have to escape the underscores:

Sample output

\documentclass{article}

\usepackage{url}

\begin{document}

Our baseline\footnote{The config can be found in the
published repository under the name
\url{dropout01.l2_1e_2.6l.n500.inpstddev3.fl2.max_seqs100.grad_noise03.nadam.lr05e_3.nbm6.nbrl.grad_clip_inf.nbm3}.}

\end{document}

Note \begin{tiny}...\end{tiny} is not defined by LaTeX, it is accident of LaTeX syntax that it works, the correct construct is {\tiny ....}. On the other hand if you wish to style the output of \url then you should redefine \UrlFont

\renewcommand{\UrlFont}{\tiny\tt}

The above example then produces

tiny samle

which is too small to read comfortably.