I have written a document with 2 chapters. At the end of each chapter, I would like to add a short appendix with mainly tables and/or figures. The document should be structured as follows:
Chapter 1
Section 1.1
Section 1.2
Appendix A
Chapter 2
Section 2.1
Section 2.2
Appendix B
In the appendices, the tables should be labelled as Table A.1, Table A.2, etc., for the first chapter, and Table B.1, Table B.2, etc., for the second chapter.
At the start of both appendices, I would like to add a short LOT, which lists the associated tables. If possible, also any figures, but currently I do not have any in the appendix.
Here is what I got so far:
\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{lipsum}
\usepackage{afterpage}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{caption}
\usepackage{babel}
\doublespacing
\begin{document}
\tableofcontents
\chapter{Trees in the forest}
\section{Trees are green}
\lipsum[1]
\section{Trees produce O2}
\lipsum[1]
\section{Appendix A: Additional infos on trees}\label{appendix:x1}
\renewcommand{\thetable}{\Alph{section}\arabic{table}}
\renewcommand{\thesubsection}{\Alph{subsection}}
\setcounter{table}{0}
\setcounter{section}{1}
\begin{table}
\caption{This is a table}
\begin{tabular}{lc}
121212121 & 121212121 \\
121212121 & 121212121 \\
121212121 & 121212121
\end{tabular}
\end{table}
\chapter{Dolphins in the ocean}
\section{Types of dolphins}
\lipsum[1]
\section{Appendix B: Additional infos on dolphins}\label{appendix:x2}
\renewcommand{\thetable}{\Alph{section}\arabic{table}}
\renewcommand{\thesubsection}{\Alph{subsection}}
\setcounter{table}{0}
\setcounter{section}{2}
\begin{table}
\caption{This is a second table}
\begin{tabular}{lc}
121212121 & 121212121 \\
121212121 & 121212121 \\
121212121 & 121212121
\end{tabular}
\end{table}
\end{document}
An alternative structure would be to have (exemplary for Chapter 1):
Chapter 1
Section 1.1
Section 1.2
Section 1.3 Appendix
So to move the appendix in a simple section. That probably makes it easier, if the alternative is too complex. Thanks for any hints.