12

I am trying to prevent a table from showing up in the list of tables. I used long table to create the table. This is the first table in my document. I know the \caption*{} command should do the trick but something weird is happening. Although the table doesn't show up in the list of tables but when I insert the next table it has a caption of "Table 2: ****". I want the numbering to start with 1 rather than 2. Can someone help?

    \documentclass[12 pt]{article}
    \usepackage{fullpage}
    \usepackage{amsmath}
    \usepackage{float}
    \usepackage{longtable}
    \usepackage{caption}

    \begin{document}
     First table is inserted here (longtable).
    \begin{longtable}{l l}
    \hline
        A & A1 \\
        B & B1 \\   
    \hline
    \caption*{}\label{TableNomen}
    \end{longtable}

    \newpage
    Second table inserted here.
    \begin{table} 
    \centering
    \caption{Influence of X}\label{TableC}
    \begin{tabular}{c c c c}
\hline 
    $10^{-5}$ & $80\times40$ & 16 & 10 \\
    $10^{-4}$ & $80\times40$ & 21 & 11 \\       
\hline
    \end{tabular}
    \end{table}
    \newpage
    \listoftables 
    \end{document}

Page 1

enter image description here

Page 2

enter image description here

List of tables

enter image description here

3
  • @Bavarious: One needs 15 reputation to flag a post. (I did it for John, though.) Nov 2, 2011 at 0:23
  • Welcome to TeX.SE. Instead of posting code snippets, it is always best to compose a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. Nov 2, 2011 at 0:51
  • I am having what I think is a similar issue here: [Multiple List of Tables entry for single longtable][1] [1]: tex.stackexchange.com/questions/34515/…
    – Hi_Im_E
    Nov 11, 2011 at 20:08

3 Answers 3

7

Add

\addtocounter{table}{-1} 

inside the longtable environment. As Boris said in his answer, if you don't want a caption for the longtable, you can safely delete the \caption* and \label commands. A little example:

\documentclass{article}
\usepackage{longtable}

\begin{document}

 \begin{longtable}{l l}
   A1 & A2
   \addtocounter{table}{-1} 
\end{longtable}

\begin{table}
  \centering
  \caption{test table}
  \label{tab:test}
  \begin{tabular}{cc}
  text1 & text2
  \end{tabular}
\end{table}

\end{document}
0
12

If the caption package is loaded anyway you can use the longtable* environment which does not increment the table counter. (See ltcaption package documentation for details.)

As opposite to \addtocounter{table}{-1} this solution does never make trouble when used with hyperref.


\documentclass[12pt]{article}
\usepackage{longtable}
\usepackage{caption}
\usepackage{hyperref}

\begin{document}
 First table is inserted here (longtable).
\begin{longtable*}{l l}
\hline
    A & A1 \\
    B & B1 \\   
\hline
%\caption*{Some text}
\end{longtable*}

\newpage
Second table inserted here.
\begin{table} 
\centering
\caption{Influence of X}\label{TableC}
...
\end{table}

\newpage
\listoftables 
\end{document}
1

If you do not want to have a caption, just omit \caption*{} altogether. By the way, you do not need \label either: you do not number your table.

1
  • But this won't solve the problem with the counter. Nov 2, 2011 at 1:08

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