[Tex/LaTex] prevent page break after AASTeX deluxetable \tablecomments and the next deluxetable

aastexpage-breakingtables

The issue is the following: there are two deluxetables (AASTeX) set after another. The \tablecomments of the first extends extends over a page boundary, such that one line of text lands on a new page.

I'd like the next deluxetable to start right after the previous table (i.e. right after those tablecomments). That is, it should start on the same page.

However, for some reason the next deluxetable adds a page break. So the page is basically blank, except for that one line of \tablecomments. Looks quite ugly.

How to get the next deluxetable to start on the same page after the previous deluxetable? And at the same time, retain the automatic page breaks in deluxetable?

It is rather hard to post a MWE on this, it would be a very long example. Essentially the code is:

\documentclass{article}
\begin{document}

\begin{deluxetable}{cc}
\tabletypesize{\scriptsize}  
\tablecaption{Test 1. \label{tab:test1}}
\tablewidth{0pt}  
\tablehead{\colhead{dummy} & \colhead{dummy}}
\startdata 
    % ... a lot of data, automatically split over 2 pages ...
    % Should be long enough so that Table Comments start at the end of one page
    % and continue with one line onto the next page.
\endata
\vspace{-0.6cm}
\tablecomments{Some rather long comment here that needs at least two lines.}
\end{deluxetable}

% The next deluxetable should start right after the first one, on the same
% page as the trailing Table Comments of the first table. For some reason, it does not.

\begin{deluxetable}{cc}
\tabletypesize{\scriptsize}  
\tablecaption{Test 2. \label{tab:test2}}
\tablewidth{0pt}  
\tablehead{\colhead{dummy} & \colhead{dummy}}
\startdata 
% ... a lot of data as well, automatically split over 2-3 pages ...
\endata
\vspace{-0.6cm}
\tablecomments{Any table comment.}
\end{deluxetable}

\end{document}

Best Answer

These deluxetables are floating objects. As far as I can make out their parameters are bp meaning that can be placed at the bottom of the page, or on a separate float page. Now by default LaTeX does not reserve much room for floats at the bottom of the page, indeed \bottomfration is by default 0.3 meaning that they may only fill the bottom 30% of the page. Also by default the number of floats allowed at the bottom, as controlled by bottomnumber is 1. You need to boost both these values to have a chance of getting both tables on the same page. For example:

Sample output

\documentclass{aastex}

\renewcommand{\bottomfraction}{0.8}
\setcounter{bottomnumber}{2}

\begin{document}
Text.

\begin{deluxetable}{cc}
\tabletypesize{\scriptsize}  
\tablecaption{Test 1. \label{tab:test1}}
\tablewidth{0pt}  
\tablehead{\colhead{dummy} & \colhead{dummy}}
\startdata 
    % ... a lot of data, automatically split over 2 pages ...
    % Should be long enough so that Table Comments start at the end of one page
    % and continue with one line onto the next page.
\enddata
\vspace{-0.6cm}
\tablecomments{Some rather long comment here that needs at least two lines.}
\end{deluxetable}

% The next deluxetable should start right after the first one, on the same
% page as the trailing Table Comments of the first table. For some reason, it does not.

\begin{deluxetable}{cc}
\tabletypesize{\scriptsize}  
\tablecaption{Test 2. \label{tab:test2}}
\tablewidth{0pt}  
\tablehead{\colhead{dummy} & \colhead{dummy}}
\startdata 
% ... a lot of data as well, automatically split over 2-3 pages ...
\enddata
\vspace{-0.6cm}
\tablecomments{Any table comment.}
\end{deluxetable}

\end{document}

In any case, if the tables don't fit they will be moved to separate pages. You can read more about float parameters at: How to influence the position of float environments like figure and table in LaTeX?.