How to convert a Markdown file to PDF

markdown, pandoc, pdf

Solution

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

Problem

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?

Original source