我在使用 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*
模板程式碼中的環境可以解決您的錯誤。