! 对齐前言中缺少 # 插入

! 对齐前言中缺少 # 插入

我在使用以下方法编译 tex 文件时遇到问题nle.cls文档类。问题似乎出在包上pgfplotstable。如果我注释掉它,我们的一切都会正常工作。该包扰乱了的工作maketitle。这是我收到的警告:

! Missing # inserted in alignment preamble.
<to be read again> 
                   \cr 
l.65 \maketitle

? 

这是最小的工作示例。

\documentclass{nle}

\usepackage{pgfplotstable} 


\title[Natural Language Engineering]
      {Natural Language Engineering \LaTeX\ Supplement}
\author[\LaTeX\ Supplement]
       {C\ls A\ls M\ls B\ls R\ls I\ls D\ls G\ls E\ns
        \TeX\ls -\ls T\ls O\ls -\ls T\ls Y\ls P\ls E\\
        Electronic Products and Composition Group,\\
        Printing Division, Cambridge University Press,
        CB2 2BS.}

\received{20 March 1995; revised 30 September 1998}

\pagerange{\pageref{firstpage}--\pageref{lastpage}}
\pubyear{1998}

\newcommand\eg{{\it e.g.\ }}
\newcommand\etc{{\it etc}}

\begin{document}

\label{firstpage}
\maketitle

\begin{abstract}
This guide is for authors who are preparing papers for the {\em Natural
Language Engineering\/} journal using the \LaTeX\ document preparation
system and the CUP NLE style file.
\end{abstract}

\section{Introduction}

\section{Introduction}

The layout design for the {\em Natural Language Engineering\/} journal
has been implemented as a \LaTeX\ style file. The NLE style file is based
on the ARTICLE style as discussed in the \LaTeX\ manual. Commands which
differ from the standard \LaTeX\ interface, or which are provided in addition
to the standard interface, are explained in this guide. This guide is not a
substitute for the \LaTeX\ manual itself.

\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|  }
\hline
\multicolumn{3}{|c|}{Country List} \\
\hline
Country Name     or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\
\hline
Afghanistan & AF &AFG \\
Aland Islands & AX   & ALA \\
Albania &AL & ALB \\
Algeria    &DZ & DZA \\
American Samoa & AS & ASM \\
Andorra & AD & AND   \\
Angola & AO & AGO \\
\hline
\end{tabular}

\label{lastpage}

\end{document}

答案1

不幸的是,该类使用依赖于内核的低级命令为作者部分定义了一些类似表格的环境tabular,这些环境被覆盖了array。这是他们的一个严重错误,因为这会使该类与标准包不兼容。

然而,并非一切都失去了,因为我们可以nle在加载之前重新定义类似表格的命令pgfplotstable,从而避免不兼容。

\documentclass{nle}

\makeatletter
\let\O@argtabularcr\@argtabularcr
\def\O@xtabularcr{\@ifnextchar[\O@argtabularcr{\ifnum 0=`{\fi}\cr}}
\let\O@tabacol\@tabacol
\let\O@tabclassiv\@tabclassiv
\let\O@tabclassz\@tabclassz
\let\O@tabarray\@tabarray
\def\author@tabular{\authorsize\def\@halignto{}\@authortable}
\let\endauthor@tabular=\endtabular
\def\author@tabcrone{{\ifnum0=`}\fi\O@xtabularcr\affilsize\itshape
 \let\\=\author@tabcrtwo\ignorespaces}
\def\author@tabcrtwo{{\ifnum0=`}\fi\O@xtabularcr[-3\p@]\affilsize\itshape
 \let\\=\author@tabcrtwo\ignorespaces}
\def\@authortable{\leavevmode \hbox \bgroup $\let\@acol\O@tabacol
 \let\@classz\O@tabclassz \let\@classiv\O@tabclassiv
 \let\\=\author@tabcrone \ignorespaces \O@tabarray}
\makeatother

\usepackage{pgfplotstable} 


\title[Natural Language Engineering]
      {Natural Language Engineering \LaTeX\ Supplement}
\author[\LaTeX\ Supplement]
       {C\ls A\ls M\ls B\ls R\ls I\ls D\ls G\ls E\ns
        \TeX\ls -\ls T\ls O\ls -\ls T\ls Y\ls P\ls E\\
        Electronic Products and Composition Group,\\
        Printing Division, Cambridge University Press,
        CB2 2BS.}

\received{20 March 1995; revised 30 September 1998}

\pagerange{\pageref{firstpage}--\pageref{lastpage}}
\pubyear{1998}

\newcommand\eg{{\it e.g.\ }}
\newcommand\etc{{\it etc}}

\begin{document}

\label{firstpage}
\maketitle

\begin{abstract}
This guide is for authors who are preparing papers for the {\em Natural
Language Engineering\/} journal using the \LaTeX\ document preparation
system and the CUP NLE style file.
\end{abstract}

\section{Introduction}

\section{Introduction}

The layout design for the {\em Natural Language Engineering\/} journal
has been implemented as a \LaTeX\ style file. The NLE style file is based
on the ARTICLE style as discussed in the \LaTeX\ manual. Commands which
differ from the standard \LaTeX\ interface, or which are provided in addition
to the standard interface, are explained in this guide. This guide is not a
substitute for the \LaTeX\ manual itself.

\label{lastpage}

\end{document}

enter image description here

相关内容