如何在目录中列出表格,或制作带有隐形标题的表格

如何在目录中列出表格,或制作带有隐形标题的表格

有没有办法将简单的表格列在表格列表中?如果我知道如何做的话,我甚至会手动输入它们。

我的表格现在看起来像这样:

\begin{center}
\begin{tabular}{l c l}
\multicolumn{3}{c}{LB medium} \\
1\% w/v & & tryptone \\
0.5\% w/v & & yeast extract \\
0.5\% w/v & & NaCl \\
 & & \\
 & & \\
\end{tabular}

\quad

\begin{tabular}{l c l}
\multicolumn{3}{c}{LB$_{Amp}$-Agarplate, pH 7} \\
1\% w/v & & tryptone \\
0.5\% w/v & & yeast extract \\
0.5\% w/v & & NaCl \\
1,5\% w/v & & Agar-Agar \\
0,01\% w/v & & Ampicillin \\
\end{tabular}
\end{center}

如果我将其更改为table环境,标题就会位于表格下方,并在其前面显示节号,这会弄乱我的格式,而且看起来不太好看。有没有办法让标题在文本中完全不可见,并将其列在内容中?或者插入一个完全不可见的表格(包括标题)并将其列在表格列表中?

答案1

您可以使用

\addcontentsline{lof}{table}{<text>} 

添加<text>LoF,具有与常规表格条目相同的格式;完整的示例:

\documentclass{article}

\begin{document}

\listoftables

\begin{center}
\begin{tabular}{l c l}
\multicolumn{3}{c}{LB medium} \\
1\% w/v & & tryptone \\
0.5\% w/v & & yeast extract \\
0.5\% w/v & & NaCl \\
 & & \\
 & & \\
\end{tabular}\quad
\begin{tabular}{l c l}
\multicolumn{3}{c}{LB$_{Amp}$-Agarplate, pH 7} \\
1\% w/v & & tryptone \\
0.5\% w/v & & yeast extract \\
0.5\% w/v & & NaCl \\
1,5\% w/v & & Agar-Agar \\
0,01\% w/v & & Ampicillin \\
\end{tabular}
\addcontentsline{lot}{table}{Some caption for the list of figures}
\addcontentsline{lot}{table}{Some other caption for the list of figures}
\end{center}

\end{document}

在此处输入图片描述

我发现这很奇怪(LoF 中有一个标题,但文档中没有文本),所以也许我误解了这个问题。

相关内容