0

I am using ieeecolor.cls for the first time - get it from https://www.embs.org/tmi/authors-instructions/, namely, https://www.embs.org/wp-content/uploads/2020/04/TMI-Template-LaTeX-2020.zip

What annoys me is that the default settings as recommended by the journal result in overfull and underfull boxes:

Overfull \hbox (109.0pt too wide) has occurred while \output is active
Overfull \hbox (162.0pt too wide) has occurred while \output is active
Underfull \hbox (badness 10000) has occurred while \output is active
Overfull \vbox (21.77283pt too high) has occurred while \output is active []

I have tried to fix them, but I don't really see where any maximum width is defined, so I have no idea why any of the elements in the header exceed these widths. Clearly, they do not exceed the standard page margins by 160 points. Then I have tried to suppress them, without luck.

What else can I try?

\vfuzz=\maxdimen
\hfuzz=\maxdimen
\hbadness=100000
\vbadness=100000

\documentclass[print]{ieeecolor}

%\usepackage{tmi}
\def\logoname{LOGO-tmi-web}
\definecolor{subsectioncolor}{rgb}{0,0.541,0.855}
\setlength{\firstpagerule}{26.5pc}
\setlength{\logowidth}{16.5pc}
\def\journalname{IEEE Transactions on Medical Imaging}

\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\title{Long title: foo bar yada yada foo bar yes thank you that's enough.}
\markboth{\journalname}{Short title}
\author{Author one, two, three, four. \thanks{\lipsum[1]}}
\maketitle
\begin{abstract}
    \lipsum[2]
\end{abstract}
\lipsum[3]
\end{document}
6
  • 1
    breaks my heart to suggest this but the class has too many features:( stick \hfuzz=\maxdimen before \maketitle and set it back to .1pt after the first page Commented Sep 15, 2020 at 16:51
  • @DavidCarlisle thank you! it's important to put \hfuzz after \documentclass - I had it before, where it is not working. (I still don't get why, because ieeecolor.cls does not contain the terms hfuzz, LoadClass, usepackage, RequirePackage [except with the color package], ...).
    – bers
    Commented Sep 16, 2020 at 11:52
  • Ah, that's due to the use of \sloppy... tex.stackexchange.com/a/211680/30810
    – bers
    Commented Sep 16, 2020 at 11:53
  • hfuzz is a tex primitive it just silences the warning so it does not appear in the class file. See tex.stackexchange.com/questions/50830/… (oh I see, you mean it being reset yes sloppy and fussy) or in this case you want really really gross, not just sloppy:-) Commented Sep 16, 2020 at 11:54
  • @DavidCarlisle "... and set it back to .1pt after the first page". Are there any triggers that I can use, such as \AtBeginDocument? I can do \pretocmd{\maketitle} for the first part, but resetting \hfuzz to previous values cannot be done using \apptocmd{\maketitle} as that appears to be too early. I could use atbegshi.
    – bers
    Commented Sep 16, 2020 at 12:20

1 Answer 1

1

Based in part on @DavidCarlisle's comment, this answer works for me in the preamble. This has three parts: the first turns off most box warnings on the page where \maketitle is issued. The next block sets the box warning values back to the previous values at the end of the page where \maketitle is issued.

The third block is only required for the journal option, I believe. It replaces a \vbox from the head code by \parbox[c][15pt][c], maintaining all spacing and still removing the

Overfull \vbox (5.0pt too high)

warnings on later pages.

% Suppress other "Underfull hbox", "Overfull *box" just before \maketitle
\pretocmd{\maketitle}{%
    \newcounter{titlepage}\setcounter{titlepage}{\value{page}}%
    \newcount\oldhbadness\oldhbadness=\hbadness\hbadness=10000
    \newdimen\oldhfuzz\oldhfuzz=\hfuzz\hfuzz=162pt%
    \newdimen\oldvfuzz\oldvfuzz=\vfuzz\vfuzz=22pt%
}{}{Error.}

% Re-enable on following page
\AtBeginShipout{%
    \ifnumequal{\value{page}}{\value{titlepage}}{%
        \global\hbadness=\oldhbadness%
        \global\hfuzz=\oldhfuzz%
        \global\vfuzz=\oldvfuzz%
    }{}%
}

% Fix "Overfull \vbox (5.0pt too high)" on later pages
\patchcmd{\@evenhead}{%
    \vbox{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
}{%
    \parbox[c][15pt][c]{\textwidth}{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
}{}{Error.}
\patchcmd{\@oddhead}{%
    \vbox{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
}{%
    \parbox[c][15pt][c]{\textwidth}{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
}{}{Error.}
\makeatother

This full MWE demonstrates the effect of suppressing warning, and generates test warnings which show that warnings are suppressed only on the title page:

\documentclass[journal,twoside,web]{ieeecolor}
\usepackage{tmi}
\usepackage{graphicx}
\usepackage{lipsum}

\newif\ifgeneratetestwarnings
\generatetestwarningstrue

\newif\ifsuppressclasswarnings
\suppressclasswarningstrue
\ifsuppressclasswarnings
    \usepackage{etoolbox}
    \usepackage{atbegshi}

    % Suppress other "Underfull hbox", "Overfull *box" just before \maketitle
    \pretocmd{\maketitle}{%
        \newcounter{titlepage}\setcounter{titlepage}{\value{page}}%
        \newcount\oldhbadness\oldhbadness=\hbadness\hbadness=10000
        \newdimen\oldhfuzz\oldhfuzz=\hfuzz\hfuzz=162pt%
        \newdimen\oldvfuzz\oldvfuzz=\vfuzz\vfuzz=22pt%
    }{}{Error.}

    % Re-enable on following page
    \AtBeginShipout{%
        \ifnumequal{\value{page}}{\value{titlepage}}{%
            \global\hbadness=\oldhbadness%
            \global\hfuzz=\oldhfuzz%
            \global\vfuzz=\oldvfuzz%
        }{}%
    }

    % Fix "Overfull \vbox (5.0pt too high)" on later pages
    \makeatletter
    \patchcmd{\@evenhead}{%
        \vbox{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
    }{%
        \parbox[c][15pt][c]{\textwidth}{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
    }{}{Error.}
    \patchcmd{\@oddhead}{%
        \vbox{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
    }{%
        \parbox[c][15pt][c]{\textwidth}{\color{subsectioncolor}\hrule height1pt width43pc depth0pt}%
    }{}{Error.}
    \makeatother
\fi

\begin{document}
\title{Title}
\author{Author \thanks{Thanks.}}
\maketitle

\lipsum[1-17]

\ifgeneratetestwarnings
    This underfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuull hbox should be a warning.

    This \mbox{overfuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuull} hbox, too (4.43956pt).

    \parbox[c][2in][s]{4cm}{This underfull vbox, too.}

    This overfull vbox, too (2.0pt):\newpage
    \begin{minipage}[t][690pt]{\textwidth}\end{minipage}
\fi

\end{document}

You must log in to answer this question.

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