0

I'm new to the whole latex stuff and came quite along with the writing of my dissertation, but unfortunately at some point I have some difficulties regarding my tables.

I use the caption package and renamed the tables in the text part "Text-table". The idea behind this, is the differentiation to the tables in the Appendix, which I want to lable "Table".

Hmy question is, how I include these two different types of labeling into my document?

Greetings and happy easter :)

3
  • 2
    Hello, and welcome ! Is there a specific reason for you to name differently two things that seem to be both regular tables ?
    – BambOo
    Apr 11, 2020 at 10:24
  • There seems to be both regular tables, marjin got the right impression, how I want to do this. The supplementary tables have to be labeled with another caption. As these tables are a more detailed description of the data in the text, whereas the Text-tables are a brief summary to strengthen the argument.
    – Soteira
    Apr 11, 2020 at 14:06
  • I have to admit, I still do not see the point of this..., but as long as you are happy with the provided help, fine by me !
    – BambOo
    Apr 11, 2020 at 14:12

1 Answer 1

1

You can use \captionsetup multiple times to change the name at arbitrary points in your document.

MWE:

\documentclass{article}
\usepackage{caption}
\begin{document}
\listoftables
\captionsetup[table]{name=Text-Table}
\begin{table}
\centering \fbox{This is a table}
\caption{A normal table}
\end{table}

\section*{Appendix}
\captionsetup[table]{name=Appendix-Table}
\begin{table}[h]
\centering \fbox{This is also a table}
\caption{A supplementary table}
\end{table}
\end{document}

Result:

enter image description here

This can be extended a bit to show the labels in the List of Tables and to restart the counter for the appendix tables. To increase the space for the labels in the List of Tables you can use tocloft.

Note that this does not work with cleveref or \autoref from hyperref, so you have to format references yourself (with see Text-Table \ref{xxx}).

\documentclass{article}
\usepackage{caption}
\DeclareCaptionListFormat{tabwithname}{\tablename~#2}
\usepackage{tocloft}
\addtolength{\cfttabnumwidth}{45pt}% More space
\begin{document}
\listoftables
\captionsetup[table]{name=Text-Table, listformat=tabwithname}
\begin{table}
\centering \fbox{This is a table}
\caption{A normal table}
\label{tbl:first}
\end{table}

\section*{Appendix}
\setcounter{table}{0}
\captionsetup[table]{name=Extra-Table}
\begin{table}[h]
\centering \fbox{This is also a table}
\caption{A supplementary table}
\label{tbl:second}
\end{table}
See Text-Table~\ref{tbl:first} and Extra-Table~\ref{tbl:second}.
\end{document}

enter image description here

1
  • Thank you. That is exact the solution I was looking for.
    – Soteira
    Apr 11, 2020 at 14:08

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.