# Deluxetable: Class memoir Error: Illegal pream-token (\string): c' used

I am using the deluxetable package within a document using a custom thesis class file built on Memoir. The following error keeps being thrown:

Class memoir Error: Illegal pream-token (\string): c' used. See the memoir class documentation for explanation.

l.179 \startdata

The error is always caused by the \startdata line of the deluxetable. Replacing or changing the case of the alignment arguments (i.e. from 'C' to 'c', or replacing all 'c' alignment arguments with 'r' for example) does not solve the problem.

Here is an MNWE:

\documentclass{memoir}
\usepackage{deluxetable}
\begin{document}
\begin{deluxetable}{lrlll}
%\tabletypesize{\footnotesize}
%\rotate
\tablewidth{0pc}
\tablecaption{ Parameters \label{table:params}}
\colhead{Parameter} & \colhead{Symbol} & \colhead{Value} & \colhead{1-    $\sigma$ Error} & \colhead{Units}}
\startdata
Observable x & $x$ & 0.21 & $\pm$ 0.04\footnote{Some footnote} & \\
\\
\\
\multicolumn{5}{c}{\emph{Some other parameters}} \\
\\
Observable y & $y$ & 5.7 & $\pm$ 0.08 & units
\enddata
\end{deluxetable}
\end{document}


I'll note the table does compile, but the error still must be fixed.

• Welcome! Unfortunately, we cannot use your code to reproduce the error as it stands. Can you reproduce with a standard class? If not, provide a link to the class. – cfr Apr 6 '17 at 22:29
• Also, a link to deluxetable.sty which doesn't seem to be on CTAN. – cfr Apr 6 '17 at 22:32
• I have linked to deluxetable and now provide a link to the class file. – Guest Apr 6 '17 at 22:47
• The class file you've linked to is unusable. Please provide a link to a usable version which includes all required backslashes. – cfr Apr 6 '17 at 23:00

I very strongly recommend NOT combining deluxetable with Memoir.

# Caveat emptor ...

The problem is that deluxetable stores the tabular specification in a macro prefixed by \string. Somehow, Memoir affects the way in which this macro is later expanded or treated.

# Recommended Solution

Forget deluxetable. Use standard packages which work with Memoir instead. For example,

\documentclass{memoir}
\usepackage{booktabs}
\usepackage[referable]{threeparttablex}
\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\caption{Parameters \label{table:params}}
\begin{tabular}{lrlll}
\toprule
Parameter & Symbol & Value & 1- $\sigma$ Error & Units\\
\midrule
Observable x & $x$ & 0.21 & $\pm$ 0.04\tnotex{tn:footnote} & \\
\\
\\
\multicolumn{5}{c}{\emph{Some other parameters}} \\
\\
Observable y & $y$ & 5.7 & $\pm$ 0.08 & units\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a]\label{tn:footnote} Some footnote
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}


# Dis-recommended Hack

IF you only need simple tabular specifications e.g. just letters with nothing fancy, then you can eliminate the \string and the tabular will be typeset as normal.

Probably.

Possibly.

At least in the case of the code in the example.

I think.

\documentclass{memoir}
\usepackage{deluxetable}
\makeatletter
\renewenvironment{deluxetable}[1]{%
\def\pt@format{#1}%
\let\@acol\pt@tabacol
\let\@tabularcr\@ptabularcr
\let\@tablenotetext\@ptablenotetext
\let\@tablenotes\@ptablenotes
\global\pt@ncol\z@
\global\pt@column\z@
\global\pt@page\@ne
}{%
\spew@tblnotes
\typeout@deluxetable
\endcenter
\end@plano@float
}
\makeatother
\begin{document}
\begin{deluxetable}{lrlll}
\tablewidth{0pc}
\tablecaption{ Parameters \label{table:params}}
\colhead{Parameter} & \colhead{Symbol} & \colhead{Value} & \colhead{1-    $\sigma$ Error} & \colhead{Units}}
\startdata
Observable x & $x$ & 0.21 & $\pm$ 0.04\footnote{Some footnote} & \\
\\
\\
\multicolumn{5}{c}{\emph{Some other parameters}} \\
\\
Observable y & $y$ & 5.7 & $\pm$ 0.08 & units
\enddata
\end{deluxetable}
\end{document}


Sorry, can't comment yet, but looks to me as the deluxetable may not be compatible with memoir on which your thesis class seems to be based. I have tested your code on sharelatex and am getting the same error. However if you change your documentclass to \documentclass{article}, the error should go away. Deluxetable is very old, from 1995 and may have a number of problems with newer classes etc.

The example below should work without a problem.

\documentclass{article}
\usepackage{deluxetable}

\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{deluxetable}{lcc}
\centering
\tabletypesize{\footnotesize}
\tablewidth{0pt}
\tablecolumns{3}
\tablecaption{THIS IS A TEST}

• Might it be better to recommend book since this is a thesis and the OP is using \mainmatter? I do think that suggesting the OP ditch the class rather than the package is a bit drastic, in any case, especially given that the package is not a standard one. (1995 is not really old in LaTeX terms, especially where tables are concerned.) But if you are going to ditch the class, substituting the equivalent standard class is probably a better option than article to write a book. – cfr Apr 7 '17 at 0:00