6

With the code

\documentclass{article}
\usepackage{array}
\begin{document}
\newcolumntype{c}{l}
$\begin{array}{cc}
a+b+c & a \\
d & e 
\end{array}$
\end{document}

I expect a warning for the redefinition of the primitive type of column c.

Indeed, in array.sty (version 2.4k 2018-12-30) we have at the ligne 241 some code which deals with such a warning.

\def\newcolumntype#1{%
  \edef\NC@char{\string#1}%
  \@ifundefined{NC@find@\NC@char}%
    {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@char
        \PackageWarning{array}%
                       {Redefining primitive column \NC@char}\fi}%
     \NC@list\expandafter{\the\NC@list\NC@do#1}}%
    {\PackageWarning{array}{Column \NC@char\space is already defined}}%

The \noexpand at the fourth line seems strange to me.

3

It was originally

\if\next\NC@char

but it was changed to

\if\noexpand\next\NC@char

I think the intended change was

\if\expandafter\noexpand\next\NC@char

to guard against array package being loaded after ! had been made active in some language setups.

the change is wrong but was done in March 1994 and no one reported it before....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.