如何消除使用 tikz 包时发生的奇怪错误?

如何消除使用 tikz 包时发生的奇怪错误?

我在一篇文章中使用 tikz 包制作了两个流程图。我使用的是 Overleaf 在线 Latex 编辑器。流程图制作得很顺利。但是,重新编译后出现了两个错误。我附上了这些错误描述的图片。我试图通过逐一删除代码来找出错误的来源,最后发现每当我引入该行时\usepackage{tikz},这两个错误就会开始出现。 错误 1错误 2

如果我使用“article”作为文档类,则不会出现此问题。我使用的类文件(由期刊提供)可以从此处下载:类文件我正在写下面的 MWE:

\documentclass{jaa}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{positioning}
%defining the style for flowchart
\tikzset{io/.style={trapezium, trapezium left angle=80, trapezium right angle=100,
minimum width=6em, minimum height=3em, text centered, draw=black, fill=blue!00},
process/.style={rectangle, minimum width=6em, minimum height=4.25em, 
text centered, draw=black, fill=orange!00,inner xsep=1ex},
arrow/.style={thick,->,>=stealth}}

\begin{document}\sloppy
\title{Title of the paper goes here:\\ Second line}

\author{AUTHOR1\textsuperscript{1}, AUTHOR2\textsuperscript{1} and AUTHOR3\textsuperscript{2,*}}
\affilOne{\textsuperscript{1}Department of P, University X, Place Pincode, Country.\\}
\affilTwo{\textsuperscript{2}Department of Q, University Z, Place Pincode, Country.}

\twocolumn[{
\maketitle

\begin{abstract}
Abstract text goes here.  Abstract text goes here.
Abstract text goes here.  Abstract text goes here.
 Abstract text goes here.
Abstract text goes here.  Abstract text goes here.
\end{abstract}
\keywords{------}
}]
\section{Introduction}
\end{document}

虽然这两个错误不会给 Overleaf 带来什么大问题,但当我尝试将 TeX 代码提交给期刊时,该网站的内置编译器无法编译代码(据说是 pdfTeX)。有人能解释一下为什么会出现这个错误吗?有什么方法可以解决这个问题吗?提前谢谢了。

答案1

该类重新定义了原语\year,这破坏了 tikz。向该类的维护者投诉,他们不应该这样做。作为一种解决方法,您可以恢复原始含义:

\let\oriyear\year
\documentclass{jaa}
\let\year\oriyear

相关内容