\engine{pdflatex}
pdfLaTeX Guide
pdfLaTeX is the fastest and most widely compatible LaTeX engine. It compiles .tex source directly to PDF, has the broadest package support of any engine, and remains the default engine for most LaTeX templates and online editors.
\section{What is pdfLaTeX}
What is pdfLaTeX?
pdfLaTeX is an extension of Donald Knuth's original TeX typesetting engine, developed by Hàn Thế Thành in the 1990s. Where the original TeX produced DVI (device-independent) files, pdfLaTeX produces PDF directly — eliminating the DVI-to-PDF conversion step and enabling PDF-specific features like hyperlinks, bookmarks, metadata, and embedded fonts.
Fastest engine
Compiles simple documents in under 1 second. The fastest of all major LaTeX engines.
Maximum compatibility
Nearly every CTAN package targets pdfLaTeX first. Expect near-zero incompatibility issues.
microtype support
Full character protrusion and expansion for professional-grade microtypography.
\section{When to Use}
When to use pdfLaTeX
\subsection{Compile Commands}
Running pdfLaTeX from the command line
pdfLaTeX is available in every TeX Live installation. Below are the most common invocations, from a basic single-pass compile to a full bibliography pipeline. Or use latexmk to automate the multi-pass pipeline.
# Basic pdfLaTeX compilation
pdflatex document.tex
# Suppress most terminal output (nonstopmode)
pdflatex -interaction=nonstopmode document.tex
# Run twice to resolve cross-references
pdflatex -interaction=nonstopmode document.tex
pdflatex -interaction=nonstopmode document.tex
# Full pipeline with bibliography
pdflatex -interaction=nonstopmode document.tex
bibtex document
pdflatex -interaction=nonstopmode document.tex
pdflatex -interaction=nonstopmode document.tex
# Write output to a specific directory
pdflatex -output-directory=./build document.texFor most documents with cross-references, pdfLaTeX must be run at least twice — once to record references, and again to resolve them. Documents with a bibliography require a bibtex or biber run between pdfLaTeX passes.
\subsection{Common Options}
Common pdfLaTeX flags
These flags control how pdfLaTeX handles errors, output paths, and shell access. Most CI/CD pipelines use -interaction=nonstopmode and -halt-on-error together.
-interaction=nonstopmodeRun without stopping on errors. Errors are logged but compilation continues. Essential for CI/CD pipelines.
-interaction=batchmodeLike nonstopmode but also suppresses all terminal output. Useful for silent batch compilation.
-output-directory=<dir>Write all output files (.pdf, .log, .aux) to the specified directory. Keeps your source tree clean.
-jobname=<name>Override the output filename. Useful when your .tex file is named generically (e.g. main.tex).
-halt-on-errorStop immediately on the first error. Combine with -interaction=nonstopmode for strict CI validation.
-shell-escapeAllow TeX to run external shell commands. Required by packages like minted (syntax highlighting) and epstopdf.
-file-line-errorPrint errors in file:line:error format — easier to parse in IDEs and CI log scanners.
-synctex=1Generate a SyncTeX file that maps PDF positions back to source lines. Enables source/PDF sync in editors.
\section{Limitations}
Known limitations
pdfLaTeX is the most mature engine, but it was designed in the 1990s and carries architectural constraints that newer engines address.
No native Unicode input
pdfLaTeX treats source files as 8-bit byte streams. You must add \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} for UTF-8 support. Characters outside the T1 font encoding require extra packages or workarounds.
No system font access
pdfLaTeX cannot load arbitrary fonts from your operating system. You are limited to fonts pre-installed in your TeX distribution (Computer Modern, Latin Modern, etc.) or fonts packaged for TeX on CTAN.
No OpenType math fonts
Modern OpenType math fonts (XITS Math, Libertinus Math, Fira Math) are not accessible from pdfLaTeX. If you need these fonts, switch to XeLaTeX or LuaLaTeX with the unicode-math package.
Limited RTL and complex script support
Right-to-left languages (Arabic, Hebrew) and complex scripts (Devanagari, Thai) require cumbersome workarounds in pdfLaTeX. XeLaTeX and LuaLaTeX handle these natively.
microtype limitations on some features
While pdfLaTeX has the best microtype support, the full character protrusion and expansion features require fonts in Type 1 or OTF format. Some newer font packages may have reduced microtype support.
\section{Alternatives}
When to switch to a different engine
pdfLaTeX is the right default for most documents. Switch engines only when a specific requirement cannot be met.
Your document contains Arabic, Chinese, Hebrew, or other non-Latin scripts
XeLaTeX or LuaLaTeXYou need to use a custom system font (e.g. a brand font from your operating system)
XeLaTeXYou want Lua scripting to generate document content programmatically
LuaLaTeXYou need modern OpenType math fonts like XITS Math or Libertinus Math
XeLaTeX or LuaLaTeXYou want latexmk to handle the multi-pass compilation pipeline automatically
latexmk (wraps pdfLaTeX)\subsection{API Usage}
Compiling with pdfLaTeX via the FormaTeX API
FormaTeX runs pdfLaTeX server-side. You send LaTeX source, we return a PDF. No TeX Live installation required on your end.
Pass "engine": "pdflatex" in your compile request
All four engines — pdfLaTeX, XeLaTeX, LuaLaTeX, and latexmk — are available on every plan. Switching engines requires only changing the engine field in your API request. See the engines overview for the full list of options.
Compile pdfLaTeX documents instantly
FormaTeX runs pdfLaTeX, XeLaTeX, LuaLaTeX, and latexmk in the cloud. No local installation needed. One API key, zero infrastructure.

