user977828
user977828

Reputation: 7679

How to start page numbering from 2 rather 1

I can not figure out how is it possible to start page numbering from 2 rather 1, i.e 2, 3, 4, ..., in Pandoc when converting to PDF?

Upvotes: 3

Views: 4180

Answers (2)

scoa
scoa

Reputation: 19867

Pandoc produces pdf through latex. You need to add \setcounter{page}{2} to your file. You could also create an option that allows you to set the starting page number in your yaml header.

  1. edit ~/.pandoc/templates/default.latex (or create it : pandoc -D latex > ~/.pandoc/templates/default.latex
  2. add the following lines in the header:

    $if(start-page)$
    \setcounter{page}{$start-page$}
    $endif$
    
  3. Add the following your document yaml header

    ---
    start-page: 2
    ---
    
  4. Compile with the usual options, e.g. pandoc mydoc.md -o mydoc.pdf

Upvotes: 2

mb21
mb21

Reputation: 39313

Pandoc relies on LaTeX for PDF generation, and you can write inline/raw TeX. So try inserting the following at the beginning of your document:

\setcounter{page}{2}

Upvotes: 4

Related Questions