Search code examples
pdfyamllatexmarkdownpandoc

How to specify numbered sections in Pandoc's PDF outline?


I managed to get numbered section and chapter with pandoc using markdown following sources :

---
toc: true
numbersections: true
---

# Big title
## Section
# Another big title
## section
### subection
## pof
## pif

I used the following command to generate pdf document:

$ pandoc outlinetest.md -o outlinetest.pdf

Chapters and sections are numbered correctly :

enter image description here

But the numbers don't appear in outlines of evince pdf viewer. Is it possible to display number in outlines with pandoc ?


Solution

  • You could use the bookmarksnumbered option of the hyperref package:

    ---
    output: pdf_document
    toc: true
    numbersections: true
    ---
    \hypersetup{bookmarksnumbered}
    
    # Big title
    ## Section
    # Another big title
    ## section
    ### subection
    ## pof
    ## pif
    

    enter image description here