CACM-RH 模板 .cls 文件有问题?节间距错误

CACM-RH 模板 .cls 文件有问题?节间距错误

我需要使用 CACM-RH 模板(https://cacm.acm.org/about-communications/author-center/author-guidelines/research-highlights-template/)。

但是,编译后我发现节/小节标题(摘要除外)后面的间距似乎不正确。我需要对 .cls 文件进行哪些更改吗?该文件上次更新于 2008 年。

PDF 输出的屏幕截图,显示部分文本与标题重叠

分数维main.tex

\documentclass{research4cacm}
\begin{document}

\title{Testing...
\thanks{The original version of this paper is entitled ``XXX" and was
published in (Title of publication, publication date, publisher.)}
}

\numberofauthors{7}
\author{
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\and
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\and
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
}

\maketitle
\begin{abstract}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
\end{abstract}

\section{Introduction}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Related Work}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Methods}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Findings}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Conclusions}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Acknowledgments}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\balancecolumns
\end{document}

research4cacm.cls文件很长(约 55 KB),因此我没有在此处包含它。可以从上面的官方链接下载,以下是 pastebin 链接:https://pastebin.com/tXqgMAyJ

答案1

给定的模板用于“正确”排版直到 TeX Live 2020。但这本质上纯属偶然,是大量黑客攻击的结果。

这是问题的一部分

\newfont{\secfnt}{ptmb8t at 12pt}
\newfont{\secit}{ptmbi8t at 12pt}    %13 Jan 00 gkmt
\newfont{\subsecfnt}{ptmri8t at 11pt}
\newfont{\subsecit}{ptmbi8t at 11pt}  %
\newfont{\ttlfnt}{phvb8t at 18pt}
\newfont{\ttlit}{phvbo8t at 18pt}    % GM 2/4/2000
\newfont{\subttlfnt}{phvr8t at 14pt}
\newfont{\subttlit}{phvro8t at 14pt} % GM 2/4/2000
\newfont{\subttlbf}{phvb8t at 14pt}  % 13 Jan 00 gkmt
\newfont{\aufnt}{phvr8t at 12pt}
\newfont{\auit}{phvro8t at 12pt}     % GM 2/4/2000
\newfont{\affaddr}{phvr8t at 10pt}
\newfont{\affaddrit}{phvro8t at 10pt} % GM 2/4/2000
\newfont{\eaddfnt}{phvr8t at 12pt}
\newfont{\ixpt}{ptmr8t at 9pt}
\newfont{\confname}{ptmri8t at 8pt}
\newfont{\crnotice}{ptmr8t at 8pt}
\newfont{\ninept}{ptmr8t at 9pt}

此类代码已被弃用约 30 年。文档或文档类应该有\newfont,除非用户或类编写者知道非常精确他们正在做什么。但事实并非如此,原因如下:

  1. 使用 Times 作为章节标题而使用 Computer Modern 作为正文简直是荒谬的;

  2. 更重要的是,用声明的命令\newfont将不会提供合适的基线跳过。

关于第 2 点,类维护者尝试通过\baselineskip 14pt在代码中声明来修复\section,但这是一个糟糕的黑客行为,并没有真正解决问题

\def\section{%
    \@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}% GM
    {4\p@}{\baselineskip 14pt\secfnt\@ucheadtrue}%
}

\def\subsection{%
    \@startsection{subsection}{2}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}
    {4\p@}{\secfnt}%
}
\def\subsubsection{%
    \@startsection{subsubsection}{3}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}%
    {4\p@}{\subsecfnt}%
}

以下是为了获得更好的结果的尝试。

\documentclass{research4cacm}

%%% Note to copy editors: the following fixes are needed
%%% in order to get decent output in the temporary version
%%% for the submission
\makeatletter
\renewcommand{\secfnt}{\fontfamily{ptm}\fontsize{12}{14}\bfseries}
\renewcommand{\subsecfnt}{\fontfamily{ptm}\fontsize{11}{13}\itshape}
\def\section{%
    \@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}% GM
    {14\p@}{\secfnt\@ucheadtrue}%
}

\def\subsection{%
    \@startsection{subsection}{2}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}
    {14\p@}{\secfnt}%
}
\def\subsubsection{%
    \@startsection{subsubsection}{3}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}%
    {14\p@}{\subsecfnt}%
}
\expandafter\def\expandafter\abstract\expandafter{\abstract\vspace{-\baselineskip}}
\makeatother
%%% end of fixes

\begin{document}

\title{Testing...
\thanks{The original version of this paper is entitled ``XXX" and was
published in (Title of publication, publication date, publisher.)}
}

\numberofauthors{7}
\author{
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\and
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
\and
\alignauthor
Fake Name\\
       \affaddr{Affiliation}\\
       \email{email}
}

\maketitle

\begin{abstract}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.
\end{abstract}

\section{Introduction}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\section{Related Work}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\section{Methods}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\subsection{A very long title that will wrap into two lines if we add more text}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\subsubsection{A very long title that will wrap into two lines if we add more text}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\subsection{Findings}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\section{Conclusions}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\section{Acknowledgments}
Text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text 
text text text text text text text text text text text text text text text text.

\balancecolumns
\end{document}

在此处输入图片描述

但是会议上的人们似乎忽略了 ACM 有一个特定的课程,称为“ACM 课程”,acmart它可以弥补 ACM 会议中大量特殊(通常写得很差)的课程。

无论如何,期刊网站说

请作者注意,以模板形式提交的论文并不代表论文的照相排版版本。与所有获准在月刊《通讯》上发表的编辑材料一样,这些论文将经过编辑和校对。作者将收到页面校样,以查看任何最后一刻的更改或更正。

所以你不必太担心最终结果。清楚地标记建议的修复,以便文字编辑知道。

相关内容