如何从表格列表/图表列表中删除标题?

如何从表格列表/图表列表中删除标题?

我想要同时拥有表格和图形的列表,但不显示任何一个浮点数的实际标题,如下所示:

表格列表

表 1 .................................. 3

表 2 ..................................5

我正在titetoc为此使用该包,这里是 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}

我可以使用这个包来做这个吗?怎么做?提前谢谢您!

答案1

使用可选参数\caption,它是列表中出现的内容;即\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}

在此处输入图片描述

答案2

您不必输入可选参数的变体:

\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} 

在此处输入图片描述

相关内容