2

My journal recently updated its official class file, aastex, from version 5.2 to version 6.0. Apparently this was a major rewrite, as the journal abandoned its own class and based 6.0 off the ancient third-party emulateapj made before the journal published class files.

Now I'm getting an italix "c" at the beginning of my pmatrix with the new version. Here's an example:

\documentclass{aastex}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
  \begin{pmatrix}
    -1 & 0 \\
    0  & 1
  \end{pmatrix}
\end{equation*}
\end{document}

With 5.2 I get this:

output from 5.2

while with 6.0 I get this:

output from 6.0

Where is this coming from, and how do I get rid of it?

5
  • (I would love to post a link to the 5.2 cls file for completeness, but I can't seem to find it hosted anywhere. All the links on the CTAN archive are dead, for example.)
    – user17829
    Jul 3, 2016 at 17:57
  • are you sure it's the right code you posted, because i dont see any 'c' in the code.
    – Cfun
    Jul 3, 2016 at 18:01
  • Indeed there is no "c" in the code, which is what makes this so baffling.
    – user17829
    Jul 3, 2016 at 18:04
  • The c comes from the internal array environment usages. The missing number error you get is from \c@MaxMatrixCols (the LaTeX counter MaxMatrixCols) which is used internally by amsmath. I've found a work-around. I don't understand what aastex6 changes, though. Jul 3, 2016 at 18:06
  • i compiled your code using the document class article instead and i got no extra 'c' so it must be from the document class aastex.
    – Cfun
    Jul 3, 2016 at 18:06

1 Answer 1

4

The problem is the internal usage of the array environment by amsmath's pmatrix. At some point

\array{*\c@MaxMatrixCols c}

is executed which prepares a table with MaxMatrixCols columns (default is 10).

(This makes it that you do not have to insert the number of columns in your table/matrix on your own. Some work around it is done to ensure that the parentheses are correctly spaced.)

If one defines \array{*{\c@MaxMatrixCols}c} instead, the code snipped works.

I don't know what aastex6 changes but it uses a lot of \newcolumntypes …

Code

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\def\env@matrix{\hskip -\arraycolsep % taken from amsmath.sty lines 895ff
  \let\@ifnextchar\new@ifnextchar
  \array{*{\c@MaxMatrixCols}c}}
\makeatother
\begin{document}
\begin{equation*}
  \begin{pmatrix}
    -1 & 0 \\
    0  & 1
  \end{pmatrix}
\end{equation*}
\end{document}
3
  • It should be noted that the end result is really ugly.
    – egreg
    Jul 3, 2016 at 19:47
  • @egreg Well, you could use mathtools pmatrix*, however aastex6 uses some redefinition of \begin which includes a spurious space which screws with mathtoolss space-aware ifnextchar. Jul 3, 2016 at 21:38
  • My impression is that aastex6 screws up all kind of matrices.
    – egreg
    Jul 3, 2016 at 21:42

You must log in to answer this question.