Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable page numbering converting markdown to pdf with pandoc [closed]

Tags:

latex

pandoc

I am converting a markdown file to pdf using pandoc. How can I suppress page numbers in the pdf file?

like image 608
sieste Avatar asked Jun 21 '13 10:06

sieste


People also ask

How do I convert markdown to PDF in pandoc?

There are actually two steps involved in converting a Markdown file to a PDF file: The Markdown source file is converted to a LaTeX source file. Pandoc invokes the pdflatex or xelatex or other TeX command and converts the . tex source file to a PDF file.

Can pandoc convert from PDF?

You can't. You can try opening the PDF in Word or Google Docs and saving in a format from which pandoc can convert directly.

Where are pandoc templates?

The default LaTeX template of Pandoc can be found at https://github.com/jgm/pandoc/tree/master/data/templates (named default.

What is pandoc used for?

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.


1 Answers

I will answer my own question here:

I learned in this post that pandoc markdown understands standard latex commands. Take for example the following markdown file called test.md:

% A pdf file without page numbers created from pandoc markdown % sieste % June 2013  \pagenumbering{gobble}  # First header etc 

and the command

pandoc test.md -o test.pdf 

produces the desired pdf without page numbers.

I tried to use \pagestyle{empty} at first, but it did not work: If I put it where \pagenumbering{gobble} is now, page numbering is only turned off from page 2 on, and the first page is still numbered. And if I put it before the title block, the title in the pdf is messed up.

like image 154
sieste Avatar answered Sep 29 '22 17:09

sieste