1

Please help! I'm wondering how I can prevent a table defined in the Appendices chapter from being listed together with other tables in the rest of the chapters. I want to have separate list for tables in normal chapters (numbered continuously) and a list for tables in appendices chapter (where I restart numbering the tables)-let's say List of Appendices. MWE files are as follows:

  1. Main File:
\documentclass{report}
\usepackage{array}
\usepackage{chngcntr}   %package to change counter
\counterwithout{table}{chapter}     %number tables continously-not chapterwise
\usepackage[format=hang]{caption} %package to change caption tag from "Table" to Appendix
\usepackage{tocloft}    %table settings
%list of table settings
\setlength{\cftchapnumwidth}{0pt}
\renewcommand{\cftchappresnum}{\chaptername\ }
\renewcommand{\cftchapaftersnum}{:}
\renewcommand{\cftchapaftersnumb}{\newline}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\begin{document}
\setlength{\cftbeforetoctitleskip}{-2em}-
\renewcommand{\contentsname}{{\normalsize TABLE OF CONTENTS }}
\begin{center}
\tableofcontents
\end{center}  % Write out the Table of Contents
\renewcommand{\listtablename}{{\normalsize LIST OF TABLES}}
\clearpage %Start a new page
\setlength{\cftbeforelottitleskip}{-2em}
\begin{center}
\renewcommand*{\addvspace}[1]{}
\listoftables%
\addcontentsline{toc}{chapter}{List of Tables}
\end{center}  % Write out the List of Tables
\include{chapterOne}
\include{chapterTwo}
\include{appendixChapter}
\end{document}
  1. Chapter One:
\chapter{}
\begin{table}[!htbp]
\caption{First Table}
\centering
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
A & 1.8 & 3.4 \\
B & 6 & 4 \\
C & 0.1 & 0.25\\
\hline
\end{tabular}
\label{table:one}
\end{table}
  1. Chapter Two
\chapter{}
\begin{table}[!htbp]
\caption{Second Table}
\centering
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
A & 10 & 30 \\
B & 6 & 4 \\
C & 2 & 6\\
\hline
\label{table:two}
\end{table}
  1. Appendices Chapter:
\chapter*{APPENDICES}
\setcounter{table}{0} \renewcommand{\thetable}{\arabic{table}}  %reset table 
\begin{table}[!htbp]
\captionsetup{name=Appendix}
\caption{Table Appendix}
\centering  
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
F & 1 & 3 \\
G & 6 & 4 \\
H & 2 & 6\\
\hline
\end{tabular}
\label{table:appendx}
\end{table}

MWE Output: Table in appendix appearing in list of tables

1 Answer 1

1

Maybe the following example helps:

\documentclass{report}
%\usepackage{chngcntr}% not needed with uptodate TeX Distributions
\counterwithout{table}{chapter}%number tables continously-not chapterwise

\usepackage[english]{babel}
\addto\captionsenglish{\renewcommand*\contentsname{Table of Contents}}

\usepackage{tocloft}
\setlength{\cftchapnumwidth}{0pt}
\renewcommand{\cftchappresnum}{\chaptername\ }
\renewcommand{\cftchapaftersnum}{:}
\renewcommand{\cftchapaftersnumb}{\newline}
\renewcommand{\cftchapdotsep}{\cftdotsep}

% settings for ToC
\setlength{\cftbeforetoctitleskip}{-2em}
\renewcommand{\cfttoctitlefont}{\hfill\normalsize\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill\mbox{}}

% settings for LoT
\setlength{\cftbeforelottitleskip}{-2em}
\renewcommand{\cftlottitlefont}{\hfill\normalsize\MakeUppercase}
\renewcommand{\cftafterlottitle}{%
  \addcontentsline{toc}{chapter}{\listtablename}%
  \hfill\mbox{}%
}
\addtocontents{lot}{\protect\renewcommand*{\protect\addvspace}[1]{}}

% new list for Tables in Appendix
\newcommand*{\listappendixtablename}{List of Tables in Appendix}
\newlistof{appendixtable}{alot}{\listappendixtablename}
% settings for LoTiA
\setlength{\cftbeforealottitleskip}{-2em}
\renewcommand{\cftalottitlefont}{\hfill\normalsize\MakeUppercase}
\renewcommand{\cftafteralottitle}{\hfill\mbox{}}

\usepackage{xpatch}
\makeatletter
\xapptocmd\appendix{%
  \chapter*{APPENDICES}%
  \markboth{}{}%
  \setcounter{table}{0}% reset table counter
  \renewcommand*{\ext@table}{alot}% write table entries in the alot file
  \listofappendixtable
}{}{\PatchFailed}
\makeatother

\begin{document}
\tableofcontents
\clearpage
\listoftables

\chapter{Bla}
\begin{table}[!htbp]
\caption{First Table}
\centering
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
A & 1.8 & 3.4 \\
B & 6 & 4 \\
C & 0.1 & 0.25\\
\hline
\end{tabular}
\label{table:one}
\end{table}

\chapter{Blubb}
\begin{table}[!htbp]
\caption{Second Table}
\centering
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
A & 10 & 30 \\
B & 6 & 4 \\
C & 2 & 6\\
\hline
\end{tabular}
\label{table:two}
\end{table}

\appendix
\begin{table}[!htbp]
\caption{Table Appendix}
\centering
\begin{tabular}{c c c}
\hline
Value 1 & Value 2 & Value 3 \\
\hline
F & 1 & 3 \\
G & 6 & 4 \\
H & 2 & 6\\
\hline
\end{tabular}
\label{table:appendx}
\end{table}
\end{document}

Result:

enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .