I am relatively new to the language, so pardon me if I am missing something obvious.

I noticed that converting a file into .tex using pandoc causes sections in the document not to be numbered. Here is an example:

\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\else % if luatex or xelatex
% use upquote if available, for straight quotes in verbatim environments
% use microtype if available
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
            pdfborder={0 0 0},
\urlstyle{same}  % don't use monospace font for urls
}{% else
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
% Redefines (sub)paragraphs to behave more like sections






More text


Any help in getting these numbers back would be appreciated!

2 Answers 2


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


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


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .