So I'm writing my thesis and was in need of a table in landscape mode as it was too big, and found a simple solution at How to place a table on a new page with landscape orientation without clearing the current page? and it worked pretty well, except that the numbering of the table is wrong when put in the appendix. The following code reproduces my problem.
\documentclass{report}
\usepackage[english]{babel}
\usepackage[titletoc, header, page]{appendix}
\usepackage{float}
\usepackage{pdflscape}
\usepackage{afterpage}
\begin{document}
\chapter{Main}
\section{section}
main section
\begin{table}[h]
\caption{main}
\end{table}
\begin{appendices}
\chapter{appchap}
\begin{table}[h]
\caption{correct numbering}
\end{table}
\afterpage{
\clearpage
\thispagestyle{empty}
\begin{landscape}
\begin{table}
\centering
\caption{wrong numbering}
\end{table}
\end{landscape}
\clearpage
}
\end{appendices}
\end{document}
The tables created, in order, are numbered 1.1, A.1, 1.2. Table 1.2 is the second in appendix and should be named A.2 in my opinion, but it doesn't seem to get the chapter number (A) right. How can I fix the numbering issue?