1

I'm using the supertabular package to create a two-column table that spans several pages. The one thing that I need is for the table caption to repeat on each page. This is the code

\documentclass[twocolumn]{article}
\usepackage[margin=0.6in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{supertabular, booktabs}
\begin{document}
    \begin{center}
        \tablefirsthead{\toprule
            col1 & col2 & col3 & col4 \\
            unit1 & unit2 & unit3 & unit4\\
                    \midrule}
       \tablehead{\toprule
            col1 & col2 & col3 & col4 \\
            unit1 & unit2 & unit3 & unit4\\
                    \midrule}
       \topcaption{some caption}\small
       \begin{supertabular}{cccc}
            \midrule
            \multicolumn{4}{l}{ \large \textbf{text}} \\
            \midrule
            value1 & value2 & value3 & value3 \\
            % MANY MORE ROWS
            \bottomrule
    \end{supertabular}
    \end{center}
\end{document}

I have tried with the longtable and xtab package but longtable does not work in twocolumn mode and xtab for some reason leaves a lot of space between the end of each column and the bottom of the page. I have not found any solution or mention to a running caption for supertabular tables.

1 Answer 1

1

You can put a fake caption in \tablehead. However, I suppose you don't want the caption in the righthand column if there was one already in the lefthand column, so we need some trickery to put it only in the lefthand column.

\newcommand\repeatcaption{%
  \if@firstcolumn\multicolumn{4}{c}{Table \thetable: some caption}\\[10pt]\fi}
\makeatother

...

       \tablehead{\repeatcaption\toprule
            col1 & col2 & col3 & col4 \\
            unit1 & unit2 & unit3 & unit4\\
                    \midrule}

Here is the complete document:

\documentclass[twocolumn]{article}
\usepackage[margin=0.6in]{geometry}
\usepackage{supertabular, booktabs}
\makeatletter
\newcommand\repeatcaption{%
  \if@firstcolumn\multicolumn{4}{c}{Table \thetable: some caption}\\[10pt]\fi}
\makeatother

\newcommand\rows{%
            value1 & value2 & value3 & value4 \\
            value5 & value6 & value7 & value8 \\
            value89 & value10 & value11 & value12 \\
}
\newcommand{\Rows}{\rows\rows\rows\rows\rows\rows\rows\rows\rows\rows}

\begin{document}
    \begin{center}
        \tablefirsthead{\toprule
            col1 & col2 & col3 & col4 \\
            unit1 & unit2 & unit3 & unit4\\
                    \midrule}
       \tablehead{\repeatcaption\toprule
            col1 & col2 & col3 & col4 \\
            unit1 & unit2 & unit3 & unit4\\
                    \midrule}
       \topcaption{some caption}\small
       \begin{supertabular}{cccc}
            \midrule
            \multicolumn{4}{l}{ \large \textbf{text}} \\
            \midrule
            \Rows
            \Rows
            \Rows
            \Rows
            \Rows
            % MANY MORE ROWS
            \bottomrule
    \end{supertabular}
    \end{center}
\end{document}

enter image description here

2
  • Thanks for the answer. Just like that it does not work, do I need to edit something like \thetable, for example?
    – bajotupie
    Commented May 6 at 14:59
  • No, \thetable is set by the table environment. I'll include the whole document. Commented May 6 at 15:39

You must log in to answer this question.

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