# Why does the \onslide command in beamer reset the dimension \hfuzz?

I needed to set \hfuzz to a very large value for a beamer frame which had a substantial number of slides overlayed. Then I found (the hard way) that I have to issue \hfuzz\maxdimen after each of the \onslide commands.

(Actually, I do not need them that big. I am putting in some codes which show overfull hboxes of varying amount (10.0pt to 50.0pt or some such), even after changing the font size. But they do not cross the frame width. Instead of putting varying amounts of \hfuzz for each case, I decided to use \maxdimen rather blindly. I simply wanted to get rid of the warning messages for which I seem to have an allergy.)

The following is a very simplified version of the above-mentioned scenario.

\documentclass{beamer}

\usepackage{verbatim}

\begin{document}

% 1
\hfuzz\maxdimen
\begin{frame}[fragile]
% 2
% \hfuzz\maxdimen
\begin{overprint}
% 3
\showthe\hfuzz
% \hfuzz\maxdimen
\onslide<+>
\showthe\hfuzz
% 4
% \hfuzz\maxdimen
\verb@ A long long long long long long long long text to be displayed@
\onslide<+>
\showthe\hfuzz
% 5
% \hfuzz\maxdimen
\verb@ Another long long long long long long long long text to be displayed@
\end{overprint}
\end{frame}

\end{document}


Indeed, in the above code, only %4 and %5 \hfuzz, after each \onslide command suppress the overfull hbox message.

A little more investigation, inserting \showthe\hfuzz at three places, evidence that \hfuzz gets reset to the default 0.5pt value after the \onslide command.

> 16383.99998pt.
l.3     \showthe\hfuzz

?
> 0.5pt.
l.6     \showthe\hfuzz
...............
?
> 0.5pt.
l.11     \showthe\hfuzz

• Why did the implementer decide to reset \hfuzz after every \onslide?

• And is there any way I can set \hfuzz to \maxdimen for a particular frame or a group of frames containing overlays?

• without looking at the source, it probably uses \sloppy which sets \hfuzz to that value. – David Carlisle Nov 11 '14 at 16:12
• @DavidCarlisle Is there any particular reason to use \sloppy inside an overlay slide? Are not they just like other regular slides? – Masroor Nov 11 '14 at 16:14
• My rule of thumb is: When I get an overfull box, I check where it is, and if it looks fine, I don't care that it is not correct according to LaTeX. – yo' Nov 12 '14 at 0:24
• @tohecz Yes, as I said, I have an aversion for the warning messages. I always find a way to shut them up. – Masroor Nov 12 '14 at 0:36

Probably beamer uses \sloppy as that sets \hfuzz to 0.5pt.
\hfuzz=\maxdimen

in the preamble then the primitive \hfuzz will be set to maxdimen and then not be accessible, any code that sets the the dimen \hfuzz will just set the dimen register and not affect the log output.
• No, actually, I do not need them that big. I am putting in some codes which show overfull hboxes of varying amount, but do not cross the frame width. Instead of putting varying amount of \hfuzz for each case, I decided to use \maxdimen rather blindly. Thanks anyway for your answer. – Masroor Nov 11 '14 at 16:33