I am trying to use siunitx in an emulateapj document, however it reports a conflict of command:

! LaTeX error: "xparse/command-already-defined"
! Command '\tablenum' already defined!
! See the LaTeX3 documentation for further information.
! For immediate help type H <return>.

generate by pdflatex of the following document:


\title{emulateapj with siunitx}

\author{Jerry Ma}

A dummy table}
\tablehead{\colhead{col1} &
\colhead{col2} \\
\colhead{\left(\si{\gram}\right)} &
 80.76 & 50.4 \\
 19.28 & 33.4 \\
\tablecomments{siunitx doesn't work}


Naively I put the following just before I load siunitx:


to solve the confliction. This time it compiles through (means I can see the output pdf file which contains a table as expected) but with errors like the following:

! Package array Error:  Illegal pream-token (\lt@expand@linewidth@): `c' used.

See the array package documentation for explanation.
Type  H <return>  for immediate help.

l.13 \begin{deluxetable}{rr}

! Missing $ inserted.
<inserted text> 
l.22 }


So, the question is, How could I make emulateapj to work with siunitx? Thank you in advance!

  • I'm afraid the answer to me looks like 'you can't'. If you load the class and the array package (used by siunitx) you get the same Illegal pream-token error. The array package is part of the core LaTeX tools set, so not working here is a big problem. Probably the deluxtable environment has its own internals that are distinct from the standard tabular set up, which will break with array.
    – Joseph Wright
    Jul 22, 2014 at 6:01
  • The deluxetable environment tweaks longtable in order to get tables as wide as the text column. Why would anybody do this is beyond my understanding.
    – egreg
    Jul 22, 2014 at 7:25

1 Answer 1


I had the same problem with the aastex documentclass. I was able to use the savesym package as a workaround:


The savesym package is used to "redefine symbols where names conflict." In this case, the conflict is with the tablenum symbol.

Note that this only solves the problem of siunitx trying to define a symbol that already exists. There is another problem pointed out by Joseph Wright: the deluxetable environment is not compatible with the array package. This is only a problem if one actually uses the deluxtable environment.

In order to use the deluxetable environment, I need to modify the environment as follows:

% redefine deluxetable for compatibility with the array package.

This can be done right after the \restoresymbol{SIX}{tablenum}. The redefinition changes \def\pt@format{\string#1}% from aastex.cls to \def\pt@format{#1}%.

There may still be some other issues lurking around, but so far these changes have worked for me.

  • 1
    Please explain what this code does. Suppose the reader does not know savesym ...
    – Mensch
    Sep 23, 2015 at 15:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .