Bowi
Bowi

Reputation: 1528

Let pandoc number sections without h1

When I am writing a documentation with markdown (in order to process it to HTML with pandoc), I always have one heading of first order (# Heading), which is the document title, and multiple headings of second order (## Heading).

But when I switch on --number-sections in pandoc, all headings have a leading number for the document title.

How can I prevent that? Is there a parameter that h1-like headings should not be numbered, or should I specify the title in another way?

Upvotes: 7

Views: 3877

Answers (2)

DogeQueen
DogeQueen

Reputation: 11

--shift-heading-level-by=-1 works for me.

Upvotes: 1

Sergio Correia
Sergio Correia

Reputation: 1101

The manual states that

Headers with the class unnumbered will not be numbered, even if --number-sections is specified.

For that, you just need to append {-} at the end of the header line

Edit: it might also be better if you specify the title within the YAML metadata (at least that's how I do it with jekyll and similar tools)

Upvotes: 4

Related Questions