10

I am writing an article which has a long table with many rows. I would like to divide this table for multiple pages but I can not change the captions of these tables like "Table 1: Blablabla" and for the second page "Table 1 Continued: Blablabla" and so on. My MWE and its output.

I want to remove "Continued" from pages after the first.

\documentclass{article}

\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm,bindingoffset=0.1cm]{geometry}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage[font=small,labelfont=bf]{caption}

\begin{document}

\begin{table}[!htb]
\centering
\caption {Some Members of the Suggested Estimator}
\label{Tab:1}
\smallskip
\begin{tabular}{c  c  c }
\toprule
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test1 & 1 & 0 \\
\midrule
test2 & 1 & 1 \\
\midrule
test3 & \newline 1 & \newline $\beta_{2} \left(x\right)$ \\
\bottomrule
\end{tabular}
\end{table}

\begin{table}[!htbp]
\centering
\caption* {\textbf{Table 1 Continued:} Blablabla}
\smallskip
\begin{tabular}{c  c  c }
\toprule
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test4 & $C_{x} $ & $\rho_{yx} $ \\
\midrule
test5 & $\rho _{yx} $ & $C_{x} $ \\
\midrule
test6 & $\rho _{yx} $ \\
\bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

Can anyone help me about it?

3
  • You tagged your question with longtable. Did you test it? May 20, 2013 at 11:34
  • Yes. but the problem is with the caption.
    – ARAT
    May 20, 2013 at 11:37
  • I followed everything in this topic tex.stackexchange.com/questions/11380/… Everything work perfectly fine BUT I do not want this "...continued" thing. Plus, I do not know how to remove it and change the caption.
    – ARAT
    May 20, 2013 at 11:54

4 Answers 4

12

The package longtable allows you to define

  1. a header for the first page by \endfirsthead
  2. a header for all next pages by \endhead
  3. a footer fo all pages expect the last one by \endfoot
  4. a footer for the last page by \endlastfoot.

In your case you can do:

\documentclass{article}

\usepackage[paper=a6paper]{geometry}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage[font=small,labelfont=bf]{caption}

\begin{document}

\begin{longtable}{ccc}
\caption {Some Members of the Suggested Estimator}\label{Tab:1}\\\toprule
\endfirsthead
\caption* {\textbf{Table \ref{Tab:1} Continued:} Blablabla}\\\toprule
\endhead
\endfoot
\bottomrule
\endlastfoot
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test1 & 1 & 0 \\
\midrule
test2 & 1 & 1 \\
\midrule
test3 & \newline 1 & \newline $\beta_{2} \left(x\right)$ \\
\midrule
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test4 & $C_{x} $ & $\rho_{yx} $ \\
\midrule
test5 & $\rho _{yx} $ & $C_{x} $ \\
\midrule
test6 & $\rho _{yx} $ \\
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test1 & 1 & 0 \\
\midrule
test2 & 1 & 1 \\
\midrule
test3 & \newline 1 & \newline $\beta_{2} \left(x\right)$ \\
\midrule
A subset of $\overline{y}_{NH}$ & $\textbf{a}$ & $\textbf{b}$\\
\midrule
test4 & $C_{x} $ & $\rho_{yx} $ \\
\midrule
test5 & $\rho _{yx} $ & $C_{x} $ \\
\midrule
test6 & $\rho _{yx} $ \\
\end{longtable}

\end{document}

enter image description here enter image description here

6
  • Are you sure that it's the right code? because it does not give me what I want.
    – ARAT
    May 20, 2013 at 12:00
  • @MuratArat: Please see my edit and my picture. May 20, 2013 at 12:00
  • But mister, this is not what I am asking.
    – ARAT
    May 20, 2013 at 12:02
  • @MuratArat: Sorry. Then I misunderstood your question. May 20, 2013 at 12:03
  • it's ok. I am appeciated for your assistance.
    – ARAT
    May 20, 2013 at 12:10
1

A very late answer ... but now we have new package for simple writing of tables

  • I understand that you actually have one long table, which you so far split in two parts manually (and have problem with tables numbering)
  • This can be elegant avoided by use of long table and appropriate define captions and column heads on the first and other pages with your table
  • For exercise lets examine, how this can be (simple) done by use longtblr, a longtable equivalent defined in the tabularray package. At this:
  • define caption style by caption package
  • used math mode for columns wit math expresions
  • inserting small vertical space after each two rows :
\documentclass{article}
\usepackage[margin=2.5cm,
            bindingoffset=0.1cm]{geometry}
\usepackage[english]{babel}
\usepackage[skip=0.25ex,
            format=plain,
            labelfont=bf,labelsep = colon,
            font=small]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\ExplSyntaxOn
% for caption style
\prg_generate_conditional_variant:Nnn \tl_if_empty:n { e } { TF }
\let \IfTokenListEmpty = \tl_if_empty:eTF
% for grouping of rows
\NewChildSelector{eachtwo}
  {
    \int_step_inline:nnnn {2}{2}{\l_tblr_childs_total_tl}
      { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
  }
\ExplSyntaxOff
% modifying the captions of tabularray
\DefTblrTemplate{firsthead}{default}%
{\addtocounter{table}{-1}%
 \captionof{table}{\InsertTblrText{caption}}%
}
\DefTblrTemplate{middlehead,lasthead}{default}%
{\addtocounter{table}{-1}%
 \captionof{table}[]{\InsertTblrText{caption} (Continued)}%
}
\SetTblrStyle{contfoot-text}{font=\footnotesize\itshape, gray5}


%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document

\begin{document}
\section{Test}
\lipsum[1-6]

\begin{longtblr}[
caption={Some Members of the Suggested Estimator},
  label={Tab:1}, ]{rowhead = 1,
                    colsep = 9pt,
                   colspec = {@{} >{\normalfont}c Q[c,$] Q[c,$] @{}},
                    row{1} = {font=\bfseries, mode=text},
                    rowsep = 0.5pt,
              row{eachtwo} = {abovesep=1ex},
                  }
    \toprule
A subset of $\overline{y}_{\mathrm{NH}}$
        & a             & b             \\
    \midrule
test 1  & 1             & 0             \\
test 2  & 1             & 1             \\
test 3  & 1             & \beta_{2}(x)  \\
test 4  & C_{x}         & \rho_{yx}     \\
test 5  & \rho_{yx}     & C_{x}         \\
test 6  & \rho _{yx}    &               \\
test 7  & 1             & 0             \\
test 8  & 1             & 1             \\
    \bottomrule
\end{longtblr}

\end{document}

enter image description here

(red lines indicate page layout)

In the case, that in document has LoT (ListofTables), than setings in MWE had to be replaced with solution described in L.J.R. answer.

0

Taking the code from the link you provided, removing the 'continued...' parts can be done by:

\documentclass{article}
\usepackage{longtable}
\begin{document}      

\begin{longtable}{ccc}
\caption{My caption for this table\label{foo}}\\\hline
Column 1 & Column 2 & Column 3\\\hline
\endfirsthead
\caption* {\textbf{Table \ref{foo} Continued:} Blablabla}
\hline
Column 1 & Column 2 & Column 3\\\hline
\endhead % all the lines above this will be repeated on every page
\hline
\multicolumn{3}{r@{}}{continued \ldots}\\
\endfoot
\hline
\endlastfoot
A & B & C\\     A & B & C\\
A & B & C\\     A & B & C\\
A & B & C\\ \newpage
A & B & C\\     A & B & C\\
A & B & C\\     A & B & C\\
\end{longtable}
\end{document}

If that was the only problem, then you should be able to put your own data in using these header/footer definitions.

4
  • so far so good but the second table does not have caption. What I want is that second table should have a caption like "Table 1 Continued: Blablabla". however, I cannot find any solution for that
    – ARAT
    May 20, 2013 at 12:09
  • @MuratArat I added the caption as per your example but that is basically back to Marco's answer
    – Chris
    May 20, 2013 at 12:14
  • so it's not an answer. I see you understand what I want but it's still not working right.
    – ARAT
    May 20, 2013 at 12:29
  • @MuratArat Well I am not too sure what is wrong with it. Is the MWE not working or does it not work with your real data? Perhaps the 'Continued...' on the footer of the first table was meant to be kept? I have edited my MWE to include that.
    – Chris
    May 20, 2013 at 12:41
0

You don't need to use the longtable. Simply use the caption package and make your first table normally with \caption{} and label it and then in the caption of the second table put: \caption*{label{table1}}.

That is it, it prevents the numbering of the second table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.