
Pandoc: How to Convert Markdown to PDF
Updated
Learn how to convert a Markdown file into a clean PDF using Pandoc & Typst

Before we start, make sure you have Homebrew installed on your computer and a Markdown file ready in a folder.
First, open your terminal so we can install Pandoc along with Typst, which acts as our PDF engine.
brew install typst pandoc
Homebrew will now download and install both packages. This may take a minute or two, so just wait until the installation finishes and your prompt returns.
Next, navigate to the folder containing your Markdown file. To convert it into a PDF, run this command:
pandoc input.md --pdf-engine=typst -o output.pdf
Just remember to replace input.md with your actual filename, and output.pdf with whatever name you want for the final file.
To make sure everything worked, run open output.pdf to view your new document and check the layout.
Using Typst as your PDF engine is much faster and requires far less disk space than installing a full LaTeX distribution.
