usepackage{algorithm2e} 有什么问题?

usepackage{algorithm2e} 有什么问题?

我正在使用日记模板撰写论文,但当我添加

\usepackage[ruled]{algorithm2e}

它会自动崩溃并出现如下错误

/usr/share/texlive/texmf-dist/tex/latex/relsize/relsize.sty:220:
Runaway argument?
{10}
Paragraph ende
d before \@tempb was complete.
<to be read again> 
                   \par 
l.220 \@tempa\small

这是怎么回事?我该如何解决?

algorithm2e请注意,我的论文中需要该包。

我的代码是https://www.overleaf.com/5851896cgssfm

Main.tex

\documentclass[twocolumn]{autart}
\usepackage{amsmath}

\usepackage{mathrsfs,makecell}          % Enable this line and disable the
                               % preceding line to obtain a two-column
                               % document whose style resembles the
                               % printed Automatica style.


\usepackage{graphicx}          % Include this line if your
                               % document contains figures,
\usepackage[dvips]{epsfig}     % or this line, depending on which
                               % you prefer.
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts, amssymb}
\usepackage{subfigure}
\usepackage{cite}
\usepackage[subnum]{cases}
\usepackage{multicol}
\usepackage{multirow}
\usepackage[justification=centering]{caption} 
\usepackage[ruled]{algorithm2e}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{lemma}{Lemma}
\newtheorem{assumption}{Assumption}
\newtheorem{proposition}{Proposition}
\newtheorem{remark}{Remark}
\newtheorem{example}{Example}
\allowdisplaybreaks 

\renewcommand{\baselinestretch}{0.9}

\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\begin{document}

 \begin{frontmatter}
 \title{Test
 \vspace{-3.5ex}
 \thanksref{footnoteinfo}}

 \thanks[footnoteinfo]{}

 \author[li]{Wangyan Li}
 %\corauth[cor1]{Corresponding author. Tel.: +86 21 55271299; fax: +86 21 55271299.}

 \address[li]{Business School, University of Shanghai for Science and Technology, Shanghai, China.\vspace{-1.5ex}}


 \begin{keyword}
 \end{keyword}

 \vspace{-1.0ex}
 \begin{abstract}
In this paper,
 \end{abstract}
 \end{frontmatter}
\end{document}

autart.cls(太大无法发布,请查找https://www.overleaf.com/5851896cgssfm

谢谢!

答案1

autart.cls(单击 Overleaf 顶部栏中的“PROJECT”将显示文件列表;然后可以查看文件。)

相关的声音这个问题,其中relsize与不兼容amsart.cls(并且可能autart.cls也不兼容。)

添加norelsize选项可以algorithm2e消除这个错误,但随后您会收到另一个错误:

Error: Command \algorithm already defined.
          Or name \end... illegal, see p.192 of the manual.

检查一下autart.cls,你确实会看到它已经定义了自己的algorithm环境。

因此它看起来algorithm2e与该日记文档类不兼容!

相关内容