1

I want to have both list of tables and figures without showing the actual caption of either float, like this:

List of Tables

Table 1 .............. 3

Table 2 .............. 5

I am using the titetocpackage for this, here is a MWE:

\documentclass{report}

\usepackage{titletoc}

\titlecontents{table}
[0pt]                                               % left margin
{\addvspace{.5cm}}%                         % above code (e.g vertical space)
{\contentsmargin{0pt} \bfseries                     % numbered entry format
    Table~\thecontentslabel\enspace%
    \large}
{\contentsmargin{0pt}\color{white}\large}                        % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage}                 % filler-page format (e.g dots)
[\addvspace{.5pc}] 

\begin{document}

\listoftables

\begin{table}
    \begin{tabular}{cc}
    Number of students & Score \\
    3 & 90--100 \\
    14 & 80--90 \\
    36 & 70--80 \\
    17 & <70 \\
    \end{tabular}
\caption{Number of students per score.}
\label{tab:Table1}
\end{table}

\end{document}

Can I do this using this package? How? Thank you in advance!

2

Use the optional argument to \caption, which is what appears in the list-of's; namely, \caption[]{Number of students per score.}.

\documentclass{report}

\usepackage{titletoc}

\titlecontents{table}
[0pt]                                               % left margin
{\addvspace{.5cm}}%                         % above code (e.g vertical space)
{\contentsmargin{0pt} \bfseries                     % numbered entry format
    Table~\thecontentslabel\enspace%
    \large}
{\contentsmargin{0pt}\color{white}\large}                        % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage}                 % filler-page format (e.g dots)
[\addvspace{.5pc}] 

\begin{document}

\listoftables

\begin{table}
    \centering
    \begin{tabular}{cc}
    Number of students & Score \\
    3 & 90--100 \\
    14 & 80--90 \\
    36 & 70--80 \\
    17 & $<$70 \\
    \end{tabular}
\caption[]{Number of students per score.}
\label{tab:Table1}
\end{table}

\end{document}

enter image description here

  • Thank you, it works perfectly in the MWE! But I am doing a huge report and if I do this the table is taken off the list of tables, any ideas why this is happening or how to fix it? Or is there any other way? – LauraP Aug 9 '17 at 17:44
  • @LauraP It should not be taken off the list of tables, to my understanding. Several tests you could run: 1) \caption[test]{Number of students per score.} to see if test shows in the list of tables (lot) for it.; 2) \caption[~]{Number of students per score.} to see if a blank space appears in the lot; 3) \caption[\mbox{}]{Number of students per score.} to see if the MWE behavior can be recaptured in your larger document. – Steven B. Segletes Aug 9 '17 at 17:53
  • @LauraP I also should have suggested removing the .lot file, before recompilation. – Steven B. Segletes Aug 9 '17 at 17:58
  • it worked with the [~] one! – LauraP Aug 9 '17 at 18:08
  • @LauraP Sounds like the documentclass is checking the width of the caption, and disallowing zero-width captions. So as not to introduce that full extra empty space into the lot (that comes with ~), you could try \caption[\kern0.1pt]{Number of students per score.} – Steven B. Segletes Aug 9 '17 at 18:20
0

A variant for which you won't have to type an optional argument:

\documentclass{report}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}

\titlecontents{table}
[0pt] % left margin
{\addvspace{.5cm}}% % above code (e.g vertical space)
{\contentsmargin{0pt} \bfseries % numbered entry format
    Table~\thecontentslabel\enspace%
    \large\vphantom}
{\contentsmargin{0pt}\large\vphantom} % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage} % filler-page format (e.g dots)
[\addvspace{.5pc}]

\begin{document}

\listoftables

\bigskip
\begin{table}[!htb]
    \centering
    \begin{tabular}{cc}
    Number of students & Score \\
    3 & 90--100 \\
    14 & 80--90 \\
    36 & 70--80 \\
    17 & $<$70 \\
    \end{tabular}
\caption{Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. Number of students per score. }
\label{tab:Table1}
\end{table}
\bigskip

\begin{table}[!htb]
    \centering
    \begin{tabular}{cc}
    Number of students & Score \\
    3 & 90--100 \\
    14 & 80--90 \\
    36 & 70--80 \\
    17 & $<$70 \\
    \end{tabular}
\caption{Number of students per score.}
\label{tab:Table1}
\end{table}

\end{document} 

enter image description here

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.