General ⇒ Single Appendix and Tables with a Single Label
-
- Posts: 9
- Joined: Sat Feb 14, 2009 11:47 pm
Single Appendix and Tables with a Single Label
(1) I have only one appendix and I want it to appear in the table of contents as "APPENDIX" (without the alphabetical numbering "A").
(2) In my appendix, I have a few tables under the same subject, which I want them to be labelled as Table A.1-1, Table A.1-2 and so on. But I want it to appear only once in the list of tables as "Table A.1".
Any suggestions or recommendation of packages?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 9
- Joined: Sat Feb 14, 2009 11:47 pm
Re: Single Appendix and Tables with a Single Label
\setcounter{secnumdepth}{-1}
\chapter{Appendix}
Then everything will be fine.
This is the best I could get so far, but I believe there must be some better way. Comments are welcomed.
Now the 2nd question is still unsolved. Any suggestion please?
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Single Appendix and Tables with a Single Label
I recommend to use the caption package, its features should be sufficient.spiderchee84 wrote:Now the 2nd question is still unsolved. Any suggestion please?
Stefan
-
- Posts: 9
- Joined: Sat Feb 14, 2009 11:47 pm
Single Appendix and Tables with a Single Label
\DeclareCaptionLabelFormat{cont}{#1˜#2-\arabic{ContinuedFloat}}
\captionsetup[ContinuedFloat]{labelformat=cont}
But I got a few errors after compilation.
The following codes are the closest to what I want, except for the List of Tables.
Code: Select all
\documentclass{report}
\begin{document}
\tableofcontents
\listoftables
\chapter{Introduction}
\setcounter{secnumdepth}{-1}
\chapter{Appendix}
\begin{table}[h]
\renewcommand\thetable{A.1-\arabic{table}}
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
1&2\\\hline
3&4\\\hline
\end{tabular}
\end{table}
\begin{table}[h]
\renewcommand\thetable{A.1-\arabic{table}}
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
5&6\\\hline
7&8\\\hline
\end{tabular}
\end{table}
\end{document}
Single Appendix and Tables with a Single Label
try something like the following:
Code: Select all
\documentclass{report}
\usepackage{caption}
% to have more space in the LOF for the number of the table
\makeatletter
\renewcommand\l@table{\@dottedtocline{1}{1.5em}{3em}}
\makeatother
\begin{document}
\tableofcontents
\listoftables
\chapter{Introduction}
\setcounter{secnumdepth}{-1}
\chapter{Appendix}
\renewcommand\thetable{A.1-\arabic{table}}
\begin{table}[!ht]
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
1&2\\\hline
3&4\\\hline
\end{tabular}
\end{table}
\begin{table}[!ht]
\captionsetup{list=no}
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
5&6\\\hline
7&8\\\hline
\end{tabular}
\end{table}
\end{document}
2) I changed [h] to [!ht] in the table environments, since the former is almost useless.
3) The redefinition of the \thetable command can be done just once (as in my code).
4) I included the code needed to avoid the table number overlapping the caption in the LOF.
-
- Posts: 9
- Joined: Sat Feb 14, 2009 11:47 pm
Re: Single Appendix and Tables with a Single Label
Is it possible to have "Table A.1" instead of "Table A.1-1" in the List of Tables?
Single Appendix and Tables with a Single Label
Code: Select all
\documentclass{report}
\usepackage{caption}
\DeclareCaptionListFormat{mytab}{A.1}
\begin{document}
\tableofcontents
\listoftables
\chapter{Introduction}
\setcounter{secnumdepth}{-1}
\chapter{Appendix}
\renewcommand\thetable{A.1-\arabic{table}}
\begin{table}[!ht]
\captionsetup{listformat=mytab}
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
1&2\\\hline
3&4\\\hline
\end{tabular}
\end{table}
\begin{table}[!ht]
\captionsetup{list=no}
\caption{My Table}
\centering
\begin{tabular}{|c|c|}\hline
5&6\\\hline
7&8\\\hline
\end{tabular}
\end{table}
\end{document}
-
- Posts: 9
- Joined: Sat Feb 14, 2009 11:47 pm
Re: Single Appendix and Tables with a Single Label
A note for other users: the \DeclareCaptionListFormat command must be put before \begin{document}, else you'll get an error.