[Tex/LaTex] longtable list of tables caption problem

captionslongtabletable of contents

I am writing a MS dissertation, and using a long table in my thesis. I have a problem related with the caption of the long table in list of tables(LoT). Table 4.1 which is seen below, is a long table and not convenient for the thesis format for LoT. I want long table to be in the same format like other tables in LoT. I solved the same problem for normal tables and figures by setting \usepackage{subfig}. However, it did not work for long table.

Table 3.5. Caption…….

4.1 Caption……..

Table 4.2. Caption……

Table 4.3. Caption……

The long table is the following. Thanks in advance for any help.

\begin{center}
\begin{longtable}{ | c | p{3cm} | c | c | c |}
\caption{Basic properties of sensors during deployment.}  \label{table:basic-property-deployment}
\\  \hline
    \textbf{Sensors} & \textbf{Location} & \textbf{Threshold} & \textbf{Base Station} & \textbf{Resistance}\\ [6pt]
    \hline
    \endfirsthead
    \multicolumn{5}{c}%
   % \bigskip 
    {\tablename\ \thetable\ . Basic properties of sensors during deployment} \\
    \hline
     \textbf{Sensors} & \textbf{Location} & \textbf{Threshold} & \textbf{Base Station} & \textbf{Resistance}\\ [6pt]
     \hline
     \endhead
     \hline \multicolumn{5}{r}{\textit{Continued on next page}} \\
     \endfoot
     \hline
     \endlastfoot

     ROWS


\end{longtable}
\end{center}

Best Answer

It always helps if you post a complete document showing all packages loaded, but as a guess longtable toc is written by

\def\LT@c@ption#1[#2]#3{%
  \LT@makecaption#1\fnum@table{#3}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
     {\let\\\space
     \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
  \fi}

So if you had

\makeatletter
\def\LT@c@ption#1[#2]#3{%
  \LT@makecaption#1\fnum@table{#3}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
     {\let\\\space
     \addcontentsline{lot}{table}{\protect\numberline{Table \thetable.}{#2}}}%
  \fi}
\makeatother

Then Table would appear in the toc (or use whatever other format your caption style is using in \addcontentsline)

Related Question