我在使用 ACM 模板(版本 2.1)的编译器latex
中发现了一个奇怪的错误。pdflatex
以下是代码:
%%
%% This is file `sample-acmsmall.tex',
%% generated with the docstrip utility.
%%
\documentclass[acmsmall]{acmart}
%%
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
\providecommand\BibTeX{{%
Bib\TeX}}}
\usepackage{CJKutf8}
% code listing
\usepackage{minted}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1} % <-- defined new list
\setlist[tabitem]{nosep, % <-- new list setup
leftmargin=*,
label=$\bullet$,
after=\vspace{-\baselineskip},
}
\usepackage{booktabs}
% text box
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\tcbset{%any default parameters
width=0.95\textwidth,
halign=justify,
center,
breakable,
colback=white
}
%%
%% end of the preamble, start of the body of the document source.
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
%%
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
\title{My Paper Title}
%%
%% The "author" command and its associated commands are used to define
%% the authors and their affiliations.
%% Of note is the shared affiliation of the first two authors, and the
%% "authornote" and "authornotemark" commands
%% used to denote shared contribution to the research.
\author{Author 1}
\affiliation{%
\institution{My University}
\streetaddress{My Street}
\city{Hong Kong}
\country{China}}
\email{[email protected]}
\author{Author 2}
\affiliation{%
\institution{My University}
\streetaddress{My Street}
\city{Hong Kong}
\country{China}}
\email{[email protected]}
\author{Author 3}
\affiliation{%
\institution{My University}
\streetaddress{My Street}
\city{Hong Kong}
\country{China}}
\email{[email protected]}
\author{Author 4}
\affiliation{%
\institution{My University}
\streetaddress{My Street}
\city{Hong Kong}
\country{China}}
\email{[email protected]}
\orcid{1234-5678-9012-3456}
%%
%% By default, the full list of authors will be used in the page
%% headers. Often, this list is too long, and will overlap
%% other information printed in the page headers. This command allows
%% the author to define a more concise list
%% of authors' names for this purpose.
\renewcommand{\shortauthors}{Authors et al.}
%%
%% The abstract is a short summary of the work to be presented in the
%% article.
\begin{abstract}
Abstract here
\end{abstract}
%%
%% This command processes the author and affiliation and title
%% information and builds the first part of the formatted document.
\maketitle
%%
%% The next two lines define the bibliography style to be used, and
%% the bibliography file.
\bibliographystyle{ACM-Reference-Format}
\bibliography{sample-base}
\end{CJK*}
\end{document}
\endinput
%%
%% End of file `sample-acmsmall.tex'.
导致标题出现错误:
类 acmart 错误:没有找到与之相关的国家。
但是从上面的代码中我们可以看到,所有的作者都标注了自己的国家,如何解决这个问题呢?
答案1
该类不需要环境或 author 和 maketitle 命令周围的其他分组。它在\maketitle
检查命令中重置为空,但仅在本地重置,因此在组结束时会重置并导致错误。
\makeatletter \gdef\@ACM@checkaffil{} \makeatother
后添加\maketitle
。
答案2
文档acmart
类似乎与CJKutf8
包不兼容。事实上,ACM 的已接受的软件包列表包括CJK
但不是 CJKutf8
。注释掉CJK*
模板代码中的环境可以解决您的错误。