Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a Markdown file to PDF

I have a Markdown file that I wish to convert to PDF so that I can upload it on Speakerdeck. I am using Pandoc to convert from markdown to PDF.

My problem is I can't specify what content should go on what page of the PDF, because Markdown doesn't provide any feature like that.

E.g., Markdown:

###Hello * abc * def  ###Bye * ghi * jkl 

Now I want Hello to be one slide and Bye to be on another slide on Speakerdeck. So, I will need them to be on different pages in the PDF that I generate using Pandoc.

But both Hello and Bye gets on the same page in the PDF.

How can I accomplish this?

like image 663
Akshar Raaj Avatar asked Jul 13 '13 13:07

Akshar Raaj


People also ask

How do I export Markdown?

You can write Markdown online in its editor or just paste in your completed text, then preview the formatted version on the right. Copy the formatted text for a quick export—or click the Export as menu to save your document in HTML, PDF, or plain text formats.


1 Answers

Via the terminal (tested in 2020)

Download dependencies

sudo apt-get install pandoc texlive-latex-base texlive-fonts-recommended texlive-extra-utils texlive-latex-extra 

Try to use

pandoc MANUAL.txt -o example13.pdf pandoc MANUAL.md -o example13.pdf 

Via a Visual Studio Code extension (tested in 2020)

  • Download the Yzane Markdown PDF extension
  • Right click inside a Markdown file (md)
  • The content below will appear
  • Select the Markdown PDF: Export (pdf) option

Note: Emojis are better in Windows than Linux (I don't know why)

Visual Studio Code Markdown PDF

like image 61
Yedhrab Avatar answered Sep 22 '22 23:09

Yedhrab