Why Org Mode Users Need PDF Export
Org Mode is one of the most powerful plain-text document systems ever built. It handles notes, task management, literate programming, academic writing, and project planning in a single, extensible framework. But Org files -- with their asterisk headings, TODO keywords, and bracket syntax -- are not something you hand to a colleague, submit to a journal, or attach to an email.
PDF is the universal exchange format for documents that need to look polished and consistent across every device and platform. Converting Org to PDF bridges the gap between Org Mode's authoring power and the outside world's expectation of professional document presentation.
The good news is that Org Mode has built-in PDF export that produces high-quality output. The process typically flows through LaTeX, which means you get access to some of the finest typesetting capabilities available anywhere. The complexity comes from configuring that pipeline to match your needs.
This guide covers every aspect of converting Org files to PDF: the built-in export system, LaTeX configuration, styling customization, handling images and tables, code block formatting, and troubleshooting the issues that trip up most users.

Prerequisites
Before you can export Org files to PDF, you need:
- Emacs with Org Mode (built in since Emacs 22; Org 9.x recommended)
- A LaTeX distribution: TeX Live (Linux, macOS), MiKTeX (Windows), or MacTeX (macOS)
- A PDF viewer to inspect the output
Verify your LaTeX installation by running:
# Check pdflatex
pdflatex --version
# Or check xelatex (better Unicode/font support)
xelatex --version
# Or check lualatex (best for modern workflows)
lualatex --version
If none of these commands return a version number, install a LaTeX distribution first. TeX Live is recommended for most users.
Method 1: Built-in Org Export (The Standard Path)
Basic Export
The fastest way to export Org to PDF:
- Open your
.orgfile in Emacs - Press
C-c C-eto open the export dispatcher - Press
lfor LaTeX export options - Press
pto export to PDF (oroto export and open)
Org generates a .tex file from your document, runs pdflatex (by default) on it, and produces a PDF. The intermediate .tex file is kept alongside the PDF.
Configuring the Export via File Headers
Org Mode documents accept export settings in the file header. These #+ lines control how the PDF is generated:
#+TITLE: My Document Title
#+AUTHOR: Your Name
#+DATE: 2026-02-19
#+OPTIONS: toc:2 num:t author:t date:t
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [12pt, a4paper]
#+LATEX_HEADER: \usepackage{geometry}
#+LATEX_HEADER: \geometry{margin=1in}
#+LATEX_HEADER: \usepackage{parskip}
| Header | Purpose | Common Values |
|---|---|---|
| #+LATEX_CLASS | Document class | article, report, book, memoir, beamer |
| #+LATEX_CLASS_OPTIONS | Class options | [12pt, a4paper], [11pt, letterpaper, twocolumn] |
| #+LATEX_HEADER | Additional LaTeX preamble | Any valid LaTeX preamble command |
| #+LATEX_COMPILER | Which LaTeX engine to use | pdflatex, xelatex, lualatex |
| #+OPTIONS | Export options | toc:t/nil, num:t/nil, author:t/nil |
Choosing the Right LaTeX Engine
The LaTeX engine you choose affects font support, Unicode handling, and compilation speed:
| Engine | Unicode | System Fonts | Speed | Best For |
|---|---|---|---|---|
| pdflatex | Limited (needs inputenc) | No | Fast | English-only documents, legacy templates |
| xelatex | Full native | Yes | Moderate | Multilingual docs, custom fonts |
| lualatex | Full native | Yes | Slower | Complex scripting, OpenType features |
For most modern documents, xelatex is the best default. Add this to your Org file header:
#+LATEX_COMPILER: xelatex
Or set it globally in your Emacs configuration:
(setq org-latex-compiler "xelatex")
Pro Tip: If your Org document contains any non-ASCII characters -- accented letters, CJK characters, mathematical symbols, emoji -- use xelatex or lualatex. The default pdflatex engine handles only ASCII and a limited set of Latin characters without additional package configuration. Switching engines eliminates an entire category of "character not found" export errors.

Handling Common Document Elements
Images
Org Mode images export to PDF via LaTeX's \includegraphics command. The syntax:
#+CAPTION: A descriptive caption
#+ATTR_LATEX: :width 0.8\textwidth :placement [htbp]
[[./images/diagram.png]]
The #+ATTR_LATEX line controls sizing and placement. Common options:
:width 0.5\textwidth-- image takes half the text width:height 5cm-- fixed height:float wrap-- text wraps around the image:placement [H]-- force image placement here (requires thefloatpackage)
Supported image formats: pdflatex supports PNG, JPG, and PDF images. xelatex and lualatex also support PNG, JPG, and PDF. If you have SVG images, convert them to PDF first using our image converter or use the svg LaTeX package with the --shell-escape flag.
Tables
Org tables export cleanly to LaTeX tables:
| Language | Typing | Paradigm |
|----------+-----------+-------------|
| Python | Dynamic | Multi |
| Rust | Static | Systems |
| Haskell | Static | Functional |
For better-looking tables, add the booktabs package:
#+LATEX_HEADER: \usepackage{booktabs}
#+ATTR_LATEX: :booktabs t
| Language | Typing | Paradigm |
|----------+-----------+-------------|
| Python | Dynamic | Multi |
| Rust | Static | Systems |
| Haskell | Static | Functional |
The booktabs style replaces the default grid lines with professional horizontal rules.
Source Code Blocks
Org's source code blocks can be exported with syntax highlighting via the minted or listings package.
Using minted (recommended, requires Pygments):
#+LATEX_HEADER: \usepackage{minted}
#+LATEX_HEADER: \setminted{fontsize=\small, frame=single, breaklines}
In your Emacs config:
(setq org-latex-listings 'minted)
(setq org-latex-minted-options
'(("fontsize" "\\small")
("frame" "single")
("breaklines" "true")))
;; minted requires -shell-escape
(setq org-latex-pdf-process
'("xelatex -shell-escape -interaction nonstopmode %f"
"xelatex -shell-escape -interaction nonstopmode %f"))
Using listings (no external dependencies):
(setq org-latex-listings t)
(setq org-latex-listings-options
'(("basicstyle" "\\ttfamily\\small")
("frame" "single")
("breaklines" "true")))
Mathematics
Org Mode supports LaTeX math notation inline and in display blocks:
Inline math: $E = mc^2$
Display math:
\begin{equation}
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\end{equation}
Or using Org's math block:
\[
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
\]
Math exports directly since the output pipeline already goes through LaTeX. For academic papers with heavy math usage, see our guide on LaTeX to PDF for academic papers, which covers equation numbering, cross-referencing, and bibliography integration.
Method 2: Pandoc Conversion
Pandoc can convert Org files to PDF as an alternative to Emacs's built-in export:
# Basic conversion
pandoc input.org -o output.pdf
# With custom styling
pandoc input.org -o output.pdf \
--pdf-engine=xelatex \
-V geometry:margin=1in \
-V fontsize=12pt \
--highlight-style=tango
# With table of contents
pandoc input.org -o output.pdf \
--toc \
--toc-depth=3 \
--pdf-engine=xelatex
Pandoc's Org Mode parser supports most Org features but not everything -- advanced features like literate programming (noweb references), custom link types, and some Org-specific export directives may not translate. For documents using advanced Org features, the built-in Emacs export is more reliable. If your final output needs to be a PDF with specific security settings, our compress-pdf and password-protect PDF tools can post-process the generated file.
Pro Tip: If you collaborate with people who do not use Emacs, Pandoc offers a useful intermediate step: convert Org to DOCX for editing by others, then convert the final version to PDF. The document converter can handle the DOCX-to-PDF step if you prefer a web-based tool. For the Org-to-DOCX conversion specifically, see our guide on converting Markdown to DOCX -- much of the Pandoc workflow is identical.
Method 3: Online Conversion
For users who do not have a LaTeX installation or prefer not to configure the export pipeline, online tools provide an alternative:
- Export your Org file to HTML first:
C-c C-e h hin Emacs - Upload the HTML file to the document converter or use the html-to-pdf tool
- Download the resulting PDF
This approach loses some LaTeX typesetting quality (particularly for mathematics and precise typography) but is adequate for simple documents.
Alternatively, use our Markdown to PDF guide as a reference: export Org to Markdown (C-c C-e m m), then convert the Markdown to PDF using any of the methods described there.
Custom Styling and Templates
Creating a Custom LaTeX Class
For consistent document styling across multiple Org files, define a custom LaTeX class in your Emacs configuration:
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("custom-article"
"\\documentclass[12pt,a4paper]{article}
\\usepackage[margin=1in]{geometry}
\\usepackage{parskip}
\\usepackage{booktabs}
\\usepackage{graphicx}
\\usepackage{hyperref}
\\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue}
\\usepackage{fancyhdr}
\\pagestyle{fancy}
\\fancyhead[L]{\\leftmark}
\\fancyhead[R]{\\thepage}
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
Then reference it in your Org file:
#+LATEX_CLASS: custom-article
Professional Document Templates
For specific document types, consider these LaTeX classes:
article-- short documents, papers, reports (default)report-- longer documents with chaptersbook-- full books with front/back mattermemoir-- highly customizable, good for thesesbeamer-- presentations (exports to PDF slides)tufte-handout-- margin notes, Tufte-style layout

Troubleshooting Common Export Errors
"LaTeX errors during compilation"
The most common issue. When export fails, check the .log file generated alongside the .tex file. Common causes:
| Error | Cause | Fix |
|---|---|---|
| Package not found | Missing LaTeX package | Install via TeX Live Manager (tlmgr install packagename) |
| Unicode char not set up | pdflatex cannot handle the character | Switch to xelatex or lualatex |
| Missing \begin | Malformed LaTeX preamble | Check #+LATEX_HEADER lines for syntax errors |
| Dimension too large | Image exceeds page bounds | Add #+ATTR_LATEX: :width 0.9\textwidth |
| Undefined control sequence | Using a command from a missing package | Add the required \usepackage in the header |
| File not found (graphics) | Image path is wrong | Use relative paths from the .org file location |
"Export succeeds but PDF looks wrong"
- No table of contents: Add
#+OPTIONS: toc:tto the header - Sections not numbered: Add
#+OPTIONS: num:tto the header - Huge margins: Add
#+LATEX_HEADER: \usepackage[margin=1in]{geometry} - Code blocks not highlighted: Configure minted or listings as described above
- Images not appearing: Check file paths and supported formats
"Export is extremely slow"
LaTeX compilation involves multiple passes (usually 2-3). Each pass can take several seconds for large documents. To speed things up:
- Reduce the number of compilation passes in
org-latex-pdf-process - Use
pdflatexinstead ofxelatex/lualatex(faster, but limited Unicode) - Avoid the
mintedpackage's-shell-escapewhen not needed - For drafts, disable
\listoffigures,\listoftables, and the index
Org-to-PDF Workflow Best Practices
-
Keep images organized. Store images in a subdirectory relative to your Org file (e.g.,
./images/). Use relative paths in your Org file so the export works regardless of the absolute directory location. -
Use xelatex by default. Unless you have a specific reason to use pdflatex, xelatex's native Unicode support prevents most character encoding issues.
-
Embed fonts for sharing. If you send the PDF to others, embed fonts so the document renders identically on their system. xelatex and lualatex embed fonts by default when using system fonts via
fontspec. -
Test incrementally. Export after each major section to catch errors early. Finding the cause of a LaTeX error in a 50-page document is much harder than in a 5-page one.
-
Use version control. Org files are plain text and work perfectly with Git. Track your
.orgfiles and any custom class definitions. Do not track generated.pdf,.tex, or.logfiles.
For related workflows, see our guide on converting Markdown to PDF -- many of the LaTeX configuration concepts apply to both Org and Markdown export pipelines. If you are working with RST files from the Python ecosystem, our RST vs Markdown comparison covers the differences and conversion options.
Wrapping Up
Org Mode's PDF export pipeline is powerful but requires some initial setup. Once you have configured your LaTeX engine, chosen a document class, and set up code highlighting, the export process becomes a single keybinding (C-c C-e l p). The output quality, especially for academic and technical documents, rivals purpose-built LaTeX editing environments.
For simple documents, the defaults work well out of the box. For professional output, invest time in creating a custom LaTeX class that matches your organization's or journal's requirements. The time spent on setup pays for itself across every document you export afterward.



