Sections not being numbered after converting with pandoc

According to the docs, you can control whether or not to number sections with the --number-sections (or -N) command line flag. So, if you want numbered sections, your build command might look like the following:

pandoc --number-sections --standalone your_file -o your_file.tex

In the tex output you would find a line like \setcounter{secnumdepth}{5}.


That is caused by

\setcounter{secnumdepth}{0}

Remove this, and you will get numbering down to subsections level. I have no idea how to make Pandoc not add that instruction though.