4

I would like to include a progress bar in my presentation and, when in draft mode, a page number below the progress bar. I have the code to do this, and it looks great, but I get one instance of this warning per frame:

Underfull \hbox (badness 10000) has occurred while \output is active

I'm hoping it's possible to avoid this warning somehow. Here is a minimized version of the progress bar/page number combo which demonstrates the warning:

\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{footline}{
    \tikz\node[draw,minimum width=\textwidth-0.25ex]{};
    foo
}
\begin{document}
\begin{frame}
\end{frame}
\end{document}

I've looked at many similar questions (1, 2, 3, 4, 5), but they all seem to involve either manually-inserted line breaks or justified table text. Mine involves neither, so their solutions don't seem to help here.

What can I do to maintain the placement of the tikz node and the text under it in my example without generating so darn many warnings?

1 Answers1

3

You need something to fill up the line, on the last line of the paragraph there is \parfillskip (after the foo but on the line with the tikz if you don't make that full width you need to pad it out.

so

\setbeamertemplate{footline}{%
    \tikz{\node[draw,minimum width=\textwidth-0.25ex]{};}\hfill\break%
    foo
}

or as suggested in commenst you could make them separate paragraphs so both get \parfillskip

David Carlisle
  • 757,742