The package:
\usepackage{chngcntr}
\counterwithin*{chapter}{part}
\renewcommand{\restoreapp}{}
Works for the first chapter of my thesis, but on the two other chapters, the count starts at every section, I don't know why it's not working for the next chapters.
\documentclass[12pt,a4paper,oneside]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{\thepage}
\lhead{}
\renewcommand{\headrulewidth}{0pt}
\usepackage{fix-cm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\numberwithin{table}{chapter}
\usepackage{marvosym}
\usepackage[style=authoryear,natbib=true]{biblatex}
\usepackage{appendix}
\usepackage{chngcntr}
\counterwithin*{chapter}{part} %To reset chapter counter for every part
\renewcommand{\restoreapp}{}
\AtBeginEnvironment{subappendices}{%
\chapter*{Appendix}
\addcontentsline{toc}{chapter}{Appendices}
\counterwithin{figure}{section}
\counterwithin{table}{section}
}
%\usepackage[toc,page]{appendix}
\usepackage{hyperref}
\hypersetup{
colorlinks = true,
citecolor = blue
}
% \usepackage{hypertex}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\addbibresource{inf.bib}
\addbibresource{aid.bib}
\addbibresource{csr.bib}
\usepackage{csquotes}
\usepackage{array}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{makeidx}
\usepackage{booktabs,caption,fixltx2e}
\usepackage[flushleft]{threeparttable}
\usepackage{bbm}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage{multirow}
\usepackage{setspace}
\usepackage{rotfloat}
\usepackage{subcaption}
\usepackage{adjustbox}
\usepackage{listings}
\usepackage{alltt}
\doublespacing
\restylefloat{figure}
\restylefloat{table}
\usepackage{mathtools}
\allowdisplaybreaks
\usepackage[lmargin=3.20cm,rmargin=3.0cm,tmargin=3cm,bmargin=3cm]{geometry}
% Set the beginning of a LaTeX document
\begin{document}
\setstretch{1.3}
\begingroup
\hypersetup{linkcolor=black}
\tableofcontents
\endgroup
\newpage
\mainmatter
\chapter{Ilkfo}
\label{Chapter 1}
\begin{doublespace}
\section{Introduction}
Text....
\section{Literature review}
\subparagraph{Background...}
This section.....
%%%%%%
%Table 1
\begin{table} [htbp]
\centering
\caption{\label{tab1}
\textbf{Summar...}}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}
\begin{tabular}{l c c c c c}\hline
\multicolumn{1}{c}{\textbf{Variable}} & \textbf{Mean} & \textbf{Std. Dev.} & \textbf{Min.} & \textbf{Max.} & \textbf{Obs.}\\ \hline
\cline{1-6}
\multicolumn{6}{l} {Panel A: } \\ \hline
Age & & & & & \\ \hline
\multicolumn{6}{l} {Panel B: } \\ \hline
Age & & & & & \\ \hline
\multicolumn{6}{l} {Panel C: } \\ \hline
Age & & & & & \\
\cline{1-6}
\end{tabular}
\end{threeparttable}
\end{adjustbox}
\end{table}
%%%%%%
\section{Results}
\subsection{... results}
%%%%%%%%%%%%%%%%%%%
%Table 5: Main regression results
\begin{table} [htbp]
\centering
\caption{\label{general}
\textbf{Ma...}}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}
\begin{tabular}{lccccccc} \toprule
\multicolumn{8}{l}{ \emph{Infor}} \\ \hline
& \multicolumn{3}{c}{Full sample} & \multicolumn{2}{c}{txt} & \multicolumn{2}{c}{text} \\
& (1) & (2) & (3) & (4) & (5) & (6) & (7) \\
\midrule
& & & & & & & \\
textx & *** & & & ** & & - & \\
\bottomrule
\end{tabular}
\begin{tablenotes} \footnotesize \item Notes: text
\end{tablenotes}
\end{threeparttable}
\end{adjustbox}
\end{table}
%%%%%%%%%%%%%%%%%%%
\end{doublespace}
\setstretch{1.3}
\newpage
\begin{subappendices}
\section{Quarterly...}
\begin{table} [htbp]
\centering
\caption{\label{quarterlytransitions}
\textbf{text}}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}
\begin{tabular}{l c c }\hline
\textbf{Change} & \textbf{$Formal_{t}$} & \textbf{$Informal_{t}$} \\ \hline
\cline{1-3}
\multicolumn{3}{l} {Panel A: } \\ \hline
$Informal_{t-1}$ & \% & \% \\ \hline
\cline{1-3}
\end{tabular}
\end{threeparttable}
\end{adjustbox}
\end{table}
\end{subappendices}
\backmatter
\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagebreak
\mainmatter
\chapter{Latin American...}
\label{Chapter 2}
\begin{doublespace}
\section{Introduction}
\begin{table} [htbp]
\caption{\label{sumstatisticsaid}
\textbf{Summary }}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}
\centering
\begin{tabular}{l c c c c }\hline
& \multicolumn{2}{c}{\underline{\textbf{ World}}} & \multicolumn{2}{c}{\underline{\textbf{Latin }}} \\
\multicolumn{1}{c}{Variable} & Mean & Obs. & Mean & Obs.\\
\hline
&&&& \\
Ln per capita Income (US\$ constant) & & & & \\ \hline
\end{tabular}
\begin{tablenotes} \footnotesize \item Sta
\end{tablenotes}
\end{threeparttable}
\end{adjustbox}
\end{table}
\section{Methodology}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% Table 1. MAIN SPECIFICATION %%%%%%%%%%%%%%%
\begin{table} [htbp]
\caption{\label{mainaid}
\textbf{Aid }}
\begin{adjustbox}{max width=\textwidth}
\begin{threeparttable}
\centering
\begin{tabular}{lcccc} \hline
&\multicolumn{2}{c}{$ Aid$} & \multicolumn{2}{c}{$d)$} \\
& (1) & (2) & (3) & (4) \\
\hline
&&&& \\
& & & & \\
\bottomrule
\end{tabular}
\begin{tablenotes} \footnotesize \item ade.
\item Notes: el.
\end{tablenotes}
\end{threeparttable}
\end{adjustbox}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{doublespace}
\backmatter
\end{document}
The table of contents looks something like this:
1 Chapter 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Literature review . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3.1 Conceptual . . . . . 12
1.3.2 Empirical . . . . . . . . . . . . . . 16
1.4 Data . . . . . . . . . . . . . . . . . . . . . . . . 19
1.4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.2 . . . . . . . . . . . . . . . . . . . . . 21
Appendices 46
1.A . . . . . . . 46
1.B . . . . . . . . . . . . . . . . 46
2 Chapter 2
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . .. . .
2.3 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4 Methodology . . . . . . . . . . . . . . . . . . . . . . . . .
\documentclass
and ending with\end{document}
) that shows your problem.\counterwithin*{chapter}{part}
, but you don't use\part
commands. It is also unclear to me, whether appendices are on the level of chapters or sections; and I guess, you don't want to have the appendices numbered within the preceding chapter.