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

David Carlisle
  • 757,742

3 Answers3

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}
Moriambar
  • 11,466
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}
Gonzalo Medina
  • 505,128
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.

Boris
  • 38,129