4

I am using autonum and amsmath with the fleqn option to left-align equations. However, this combination appears to generate Overfull \hbox warnings at the \begin{document} line. I am using the latest Macports TeXLive distribution.

Here is a MWE:

\documentclass{article}

\usepackage[fleqn]{amsmath}
\usepackage{autonum}

\begin{document}

Some filler text.

\end{document}

And here's what the pdflatex build log shows:

Overfull \hbox (5.00003pt too wide) in paragraph at lines 6--6
 [] 
 []


Overfull \hbox (5.00003pt too wide) in paragraph at lines 6--6
 [] 
 []


Overfull \hbox (15.00003pt too wide) detected at line 6
 []$[]     $ 
 []


Overfull \hbox (5.00003pt too wide) in paragraph at lines 6--6
 [] 
 []


Overfull \hbox (5.00003pt too wide) in paragraph at lines 6--6
 [] 
 []

I don't actually see any typesetting problems, so it seems like the warnings are just cluttering the log. The warnings disappear if I remove the fleqn option.

Is there some unseen problem with using the autonum package with left-aligned equations? How can I fix or hide these warnings and still maintain the fleqn behavior?

3
  • You can suppress warnings up to a certain point if that is tolerable. \hfuzz = 16pt: tex.stackexchange.com/questions/13715/…
    – dustin
    Oct 10, 2014 at 3:08
  • @dustin: seems like a reasonable option. Although, since I'd rather not set \hfuzz to something that large globally, I guess I could patch autonum in the right place.
    – ASR
    Oct 10, 2014 at 4:20
  • @dustin No, that's wrong advice.
    – egreg
    Oct 10, 2014 at 8:43

1 Answer 1

4

It's a problem due to the timing when the relevant parameters are set. However it can be fixed by telling autonum to ignore overfull box messages when it does its tentative math environment in order to establish some internal values.

The code

\def\autonum@saveEnvironmentSubcommands#1#2#3{%
\begin{textblock}{1}[1,1](0,0)%
\begin{#2}%

(lines 107–109 in autonum.sty) should better be

\def\autonum@saveEnvironmentSubcommands#1#2#3{%
\begin{textblock}{1}[1,1](0,0)%
\hfuzz=\maxdimen % ignore overfull box messages
\begin{#2}%

and you can patch it until it's fixed in the package:

\documentclass{article}

\usepackage[fleqn]{amsmath}
\usepackage{autonum}

\makeatletter
\patchcmd{\autonum@saveEnvironmentSubcommands}
  {(0,0)\begin}
  {(0,0)\hfuzz=\maxdimen\begin}                              
  {}{}
\makeatother

\begin{document}

Some filler text.
\begin{equation}\label{a}
1=1
\end{equation}
%\ref{a}

\end{document}

This setting of \hfuzz will be local to the textblock environment, so it won't affect the rest of the document.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .