[Tex/LaTex] deluxetable* caption not displaying

captionstables

I am trying to create a page-wide deluxetable using the two-column formatted ApJ article style. The caption displays when creating a single column deluxetable, but will not display when I use deluxetable*. I receive the following error:

"Package ltcaption error: Not allowed in longtable* environment"

Here is my preamble and minimal compilable code:

\documentclass[apj]{emulateapj}
\usepackage{subcaption}
\usepackage{tablefootnote}
\begin{document}

%Table 1: Non-working example
\begin{deluxetable*}{cc}
\tabletypesize{\footnotesize}
\tablewidth{0.99\textwidth}
\tablecaption{This caption does not display}
\tablehead{
\colhead{col 1$^{1}$} & 
\colhead{col 2} 
} 
\startdata
1 & 1 \\
1 & 1
\enddata
\tablenotetext{1}{Footnote}
\end{deluxetable*}

%Table 2: Working example
\begin{deluxetable}{cc}
\tabletypesize{\footnotesize}
\tablewidth{0.99\textwidth}
\tablecaption{This caption does display}
\tablehead{
\colhead{col 1$^{1}$} & 
\colhead{col 2} 
} 
\startdata
1 & 1 \\
1 & 1
\enddata
\tablenotetext{1}{Footnote}
\end{deluxetable}

\end{document}

Best Answer

When you compile your code, you get this warning from caption package

Package caption Warning: Unsupported document class (or package) detected,
(caption)                usage of the caption package is not recommended.
See the caption package documentation for explanation.

Hence you can't use subcaption package which is responsible for loading caption package. As a matter of fact, the subsequently loaded ltcaption package (by caption) defines lontable* command which is apparently defined by emulateapj.

Hence removing \usepackage{subcaption} should enable your code to compile. However, the package tablefootnote starts giving warnings:

Package etoolbox Warning: Patching '\begin' failed!
(etoolbox)                '\AtBeginEnvironment' will not work.


Package etoolbox Warning: Patching '\end' failed!
(etoolbox)                '\AtEndEnvironment' will not work.


Package etoolbox Warning: Patching '\end' failed!
(etoolbox)                '\AfterEndEnvironment' will not work.

etoolbox is used by tablefootnote BTW. To be on safer side don't use tablefootnote also.

\documentclass[apj]{emulateapj}
%\usepackage{subcaption}
%\usepackage{tablefootnote}
\begin{document}

%Table 1: Non-working example
\begin{deluxetable*}{cc}
\tabletypesize{\footnotesize}
\tablewidth{0.99\textwidth}
\tablecaption{This caption does not display}
\tablehead{
\colhead{col 1$^{1}$} &
\colhead{col 2}
}
\startdata
1 & 1 \\
1 & 1
\enddata
\tablenotetext{1}{Footnote}
\end{deluxetable*}

%Table 2: Working example
\begin{deluxetable}{cc}
\tabletypesize{\footnotesize}
\tablewidth{0.99\textwidth}
\tablecaption{This caption does display}
\tablehead{
\colhead{col 1$^{1}$} &
\colhead{col 2}
}
\startdata
1 & 1 \\
1 & 1
\enddata
\tablenotetext{1}{Footnote}
\end{deluxetable}

\end{document}

enter image description here

Related Question