如何使用 ieeecolor 忽略壞框?

如何使用 ieeecolor 忽略壞框?

我在用ieeecolor.cls第一次使用 - 從以下位置獲取https://www.embs.org/tmi/authors-instructions/,即https://www.embs.org/wp-content/uploads/2020/04/TMI-Template-LaTeX-2020.zip

令我煩惱的是,期刊推薦的預設設定會導致框架過滿和未滿:

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 []

我試圖修復它們,但我並沒有真正看到在哪裡定義了最大寬度,所以我不知道為什麼標題中的任何元素超出了這些寬度。顯然,它們沒有超出標準頁邊距 160 磅。然後我試圖壓制他們,但沒有成功。

我還能嘗試什麼?

\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}

答案1

部分基於@DavidCarlisle 的評論,這個答案在序言中對我有用。這包含三個部分:第一個部分關閉\maketitle發出頁面上的大多數框警告。下一個區塊將框警告值設定回\maketitle發布頁面末尾處的先前值。

journal我相信第三個區塊只是該選項所必需的。它將\vbox頭部代碼中的 a 替換為\parbox[c][15pt][c],保持所有間距並仍然刪除

溢位 \vbox(5.0pt 太高)

後面幾頁有警告。

% 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

這個完整的 MWE 演示了抑制警告的效果,並產生測試警告,顯示警告僅在標題頁上被抑制:

\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}

相關內容