0

Background

I am writing a journal manuscript which limits the number of tables, hence, I want to include 3 tabular in a single table environment. Page size is A4. I have also defined C and L columntypes for convenience. Sample code is given below:

\documentclass[12pt]{article}
\usepackage[natbibapa]{apacite}
\bibliographystyle{apacite}
\usepackage{natbib}
\usepackage{longtable} % multipage tables
\usepackage{rotating}  %for rotating table
\usepackage{diagbox}  % used in table
\usepackage{adjustbox}  % used in table
\usepackage{floatpag}
\usepackage{booktabs}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}  % center align the text in the table with fixed width of the column
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}  % left align the text in the table with fixed width of the column

\newcolumntype{C}[1]{>{\centering\let\newline\\arraybackslash\hspace{0pt}}m{#1}}
% center align the text in the table with fixed width of the column \newcolumntype{L}[1]{>{\raggedright\let\newline\\arraybackslash\hspace{0pt}}m{#1}}
% left align the text in the table with fixed width of the column \begin{document} \begin{table}[H] \centering \caption{Nomenclature} \label{tab: Subscripts and superscripts}

    \begin{tabular}{@{}C{1.5cm}L{3.5cm}lC{1.5cm}L{4.5cm}@{}}
        %   \begin{tabular}{@{}cllcl@{}}
        \toprule
        \multicolumn{2}{c}{\textbf{Superscripts}} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{2}{c}{\textbf{Subscripts}} \\ \midrule
        $n$ & n &  & $i$ & i \\
        $n$ & n &  & $i$ & i \\
        $n$ & n &  & $i$ & i \\
        $n$ & n &  & $i$ & i \\
    \end{tabular}
    \begin{tabular}{C{2cm}L{11cm}}
        \toprule
        \multicolumn{1}{c}{\textbf{Variable}} & \multicolumn{1}{c}{\textbf{Description}} \\ 
        \midrule
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\
        $D$ & variable \\

\bottomrule \vspace{5mm} \end{tabular}

\begin{tabular}{C{2cm}L{11cm}}
        \toprule
        \multicolumn{1}{c}{\textbf{Parameter}} & \multicolumn{1}{c}{\textbf{Description}} \\ 
        \midrule
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\
    $a$ & parameter \\

$a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ $a$ & parameter \ \bottomrule \end{tabular} \end{table} \end{document}

Screenshot of the pdf is shown below: output

As you can see, this table cannot fit in a single page. Hence, I need to break the third table (tabular) and continue it across the next page. How to achieve this?

Issues regarding longtable

Answers to several questions suggested to use the package longtable for this purpose, for example - a, b, c, d, e.

longtable works well for a single tabular across multiple pages but not in case of multiple tabulars.

How to continue with multiple tabular environments across multiple pages?

  • By replacing tabular with longtable? – Zarko Aug 28 '20 at 14:01
  • I tried that: Package array Error: Illegal pream-token (\centering): `c' used. \centering

    This was the error.

    – Neeraj Hanumante Aug 28 '20 at 14:03
  • A longtable is not a float, hence you shouldn't nest it in a table environment. Also, why don't merge the last two tabulars in a single longtable, since they have the same preamble? – Bernard Aug 28 '20 at 14:08
  • 2
    The three tabular groups don't seem to be all that closely related. Is there a reason for not using three separate table environments? – Mico Aug 28 '20 at 14:47
  • Or three separate longtables? If you don't add a caption, they won't be numbered. – John Kormylo Aug 28 '20 at 14:47
  • 2
    also please fix your example, we can not "see that it does not fit on a page" as we have no idea of your page size, nor what font size you are using nor how the C or Lcolumn types are defined, Can you make the example a small but complete document that shows the issue. – David Carlisle Aug 28 '20 at 15:50

0 Answers0