Dear Nampuna,

So two quick responses:

1) You can defined numbering within subsections as well. You need to change this line from:

\numberwithin{table}{section}

to

\numberwithin{table}{subsection}

2) What you want to do is not optimal to achieve on Overleaf. With so many tables it will definitely give errors compiling.

Here I would suggest you have LaTeX locally installed using MikTeX (https://miktex.org/download) and a compiler like TeX Studio:

https://www.texstudio.org/

Basically you need to write the file contents file in Stata. You can invoke loops within Stata and push the tables to the .tex file and compile the pdf.

Here are some examples of calling TeX from Stata:

I will also write a guide on local Stata-to-TeX compiling.

## More from Asjad Naqvi

Here you will find information on Stata, COVID-19, and data visualizations.

## Stata graphs: Spider plots

Get the Medium app