TransWikia.com

How to ignore bad boxes with ieeecolor?

TeX - LaTeX Asked on December 27, 2020

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}
deflogoname{LOGO-tmi-web}
definecolor{subsectioncolor}{rgb}{0,0.541,0.855}
setlength{firstpagerule}{26.5pc}
setlength{logowidth}{16.5pc}
defjournalname{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}

One Answer

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}}%
    newcountoldhbadnessoldhbadness=hbadnesshbadness=10000
    newdimenoldhfuzzoldhfuzz=hfuzzhfuzz=162pt%
    newdimenoldvfuzzoldvfuzz=vfuzzvfuzz=22pt%
}{}{Error.}

% Re-enable on following page
AtBeginShipout{%
    ifnumequal{value{page}}{value{titlepage}}{%
        globalhbadness=oldhbadness%
        globalhfuzz=oldhfuzz%
        globalvfuzz=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}

newififgeneratetestwarnings
generatetestwarningstrue

newififsuppressclasswarnings
suppressclasswarningstrue
ifsuppressclasswarnings
    usepackage{etoolbox}
    usepackage{atbegshi}

    % Suppress other "Underfull hbox", "Overfull *box" just before maketitle
    pretocmd{maketitle}{%
        newcounter{titlepage}setcounter{titlepage}{value{page}}%
        newcountoldhbadnessoldhbadness=hbadnesshbadness=10000
        newdimenoldhfuzzoldhfuzz=hfuzzhfuzz=162pt%
        newdimenoldvfuzzoldvfuzz=vfuzzvfuzz=22pt%
    }{}{Error.}

    % Re-enable on following page
    AtBeginShipout{%
        ifnumequal{value{page}}{value{titlepage}}{%
            globalhbadness=oldhbadness%
            globalhfuzz=oldhfuzz%
            globalvfuzz=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}

Correct answer by bers on December 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP