Type something to search...

Quickly Convert Markdown to Academic-Style Paper PDF on macOS

In this guide, I'll walk you through how I convert Markdown documents to academic-style paper PDFs on macOS using Pandoc and BasicTeX. This method is quick and straightforward, perfect for when you need to create professional-looking PDF files for your academic papers.

Step 1: Install Pandoc and BasicTeX

First, you'll need to install Pandoc and BasicTeX on your macOS system. Here's how I did it:

  1. Install Pandoc: Open Terminal and enter the following command to install Pandoc:

    brew install pandoc
  2. Install BasicTeX: Since MacTeX is quite large, I opted for the smaller BasicTeX package to save space. Run this command:

    brew install --cask basictex
  3. Install Common LaTeX Packages: To ensure you have the necessary packages for generating PDFs, run these commands:

    sudo tlmgr update --self
    sudo tlmgr install collection-basic collection-latex collection-latexrecommended collection-fontsrecommended

Step 2: Prepare Your Markdown File

Next, create your Markdown file (e.g., paper.md). Here’s how I set up my file, including the title, author, date, and contact information:

title: "Your Paper Title"
subtitle: "Optional Subtitle"
date: \today

author: |
  | Your Name
  | [email protected]
  | www.tanshuai.com

# Abstract

Your abstract here.

# Introduction

Your introduction here.

# Methodology

Your methodology here.

# Results

Your results here.

# Conclusion

Your conclusion here.

Step 3: Convert Markdown to PDF with Pandoc

Now, you can convert your Markdown file to a PDF. I used the following command in Terminal:

pandoc paper.md -o paper.pdf --pdf-engine=xelatex

This command uses Pandoc's default LaTeX template to convert the Markdown file into an academic-style paper PDF, including the author's contact information below their name.

Additional Tips

  • Custom LaTeX Template: If you need more advanced formatting or specific styles, you can create or download a custom LaTeX template and use it with Pandoc:

    pandoc paper.md -o paper.pdf --pdf-engine=xelatex --template=your-template.tex
  • More Metadata: You can add extra information in the YAML metadata header, such as an abstract or keywords, and use these in custom templates.


By following these steps, you can easily convert Markdown documents to academic-style paper PDFs on macOS. Using Pandoc and BasicTeX makes this process quick and efficient, perfect for when you need to generate professional PDF documents. Whether you're preparing academic papers, technical reports, or other formal documents, this method works great. Including contact information in the metadata header adds a professional touch to your documents.

I hope you find this guide helpful! If you have any questions or run into issues, feel free to reach out. Happy writing!

Related Post

AWS CodeCommit: The GitHub Large File Storage (Git LFS) Free Alternative

AWS CodeCommit offers a robust alternative to GitHub's Large File Storage (Git LFS) service, providing an efficient solution for managing large files in your Git repositories. Why You Should Reco

Read More

Electron Build Tools `ERROR Error: Failed to run "choco install pywin32 --yes"`

When working with Electron Build Tools, you might encounter an error related to the installation of pywin32 via Chocolatey. This can be frustrating, especially when it's a required dependency for you

Read More

Get current commit id of Git and update to package.json

When developing a Node.js project, you may want to keep track of the current commit ID of your Git repository. This information can be useful for debugging, versioning, or deployment purposes. One wa

Read More

Migrate a GitHub LFS (Git Large File Storage) repository to AWS CodeCommit

I recently migrated one of my GitHub repositories, which uses Git Large File Storage (LFS), over to AWS CodeCommit. I thought I'd share the process with you in case you’re looking to do something sim

Read More

Reset/Restore All subdirectories of Git

Managing a Git repository effectively often requires resetting or restoring subdirectories to maintain a clean and functional codebase. This guide provides a concise, step-by-step approach to reset o

Read More