[Tex/LaTex] endfloat: List of Tables and Figures at end of each chapter

endfloattable of contents

How can I put a list of tables and figures after each chapter, rather than just once at the end of the document?

\documentclass[a4paper,12pt,twoside]{book}
\usepackage{pdflscape}

\usepackage{endfloat}

\renewcommand{\theposttable}{\Roman{posttbl}}
\renewcommand{\thepostfigure}{\Roman{postfig}}
\renewcommand{\thefigure}{\Roman{figure}}
\renewcommand{\thetable}{\Roman{table}}

% new environment for landscape tables    
\newenvironment{ltable}
  {\begin{landscape}\begin{table}}
  {\end{table}\end{landscape}}

% make it known to endfloat
\DeclareDelayedFloatFlavor{ltable}{table}

\begin{document}

\chapter{This is Chapter 1}
Some text in chapter 1.  See my figure \ref{tab:table1}.

\begin{table}
\caption{First Table} \label{tab:table1}
\end{table}

\chapter{This is Chapter 2}
Some text in chapter 2.  See my figure \ref{tab:table2}.

\begin{ltable}
\caption{First Table} \label{tab:table2}
\end{ltable}

\end{document}

Best Answer

Use the titletoc package to generate the partial LoFs:

\documentclass[a4paper,12pt,twoside]{book}
\usepackage{pdflscape}
\usepackage[notablist]{endfloat}
\usepackage{titletoc}

\renewcommand{\theposttable}{\Roman{posttbl}}
\renewcommand{\thepostfigure}{\Roman{postfig}}
\renewcommand{\thefigure}{\Roman{figure}}
\renewcommand{\thetable}{\Roman{table}}

% new environment for landscape tables    
\newenvironment{ltable}
  {\begin{landscape}\begin{table}}
  {\end{table}\end{landscape}}

% make it known to endfloat
\DeclareDelayedFloatFlavor{ltable}{table}

\begin{document}

\chapter{This is Chapter 1}
\startlist{lot}
Some text in chapter 1.  See my figure \ref{tab:table1}.

\begin{table}
\caption{First Table} \label{tab:table1}
\end{table}

\begin{table}
\caption{Second Table} \label{tab:table2}
\end{table}

\printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
\processdelayedfloats

\chapter{This is Chapter 2}
\startlist{lot}
Some text in chapter 2.  See my figure \ref{tab:table2}.

\begin{ltable}
\caption{Third Table} \label{tab:table3}
\end{ltable}

\begin{ltable}
\caption{Fourth Table} \label{tab:table4}
\end{ltable}

\begin{ltable}
\caption{Fifth Table} \label{tab:table5}
\end{ltable}

\printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
\processdelayedfloats

\end{document}

Images of the partial lists:

enter image description here

and

enter image description here

After each chapter, use \startlist{lof} and at the end of a chapter, use

\printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
\processdelayedfloats