Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 \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}
share|improve this question

migrated from stackoverflow.com Nov 2 '11 at 0:45

This question came from our site for professional and enthusiast programmers.

    
@Bavarious: One needs 15 reputation to flag a post. (I did it for John, though.) –  Paŭlo Ebermann Nov 2 '11 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. –  Peter Grill Nov 2 '11 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 '11 at 20:08

3 Answers 3

up vote 5 down vote accepted

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}
share|improve this answer
    
This worked beautifully. Thanks! –  John Smith Nov 2 '11 at 1:19

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}
share|improve this answer

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.

share|improve this answer
    
But this won't solve the problem with the counter. –  Gonzalo Medina Nov 2 '11 at 1:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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