LinuxCommandLibrary

latex

TLDR

Compile LaTeX document

$ latex [document.tex]
copy
Compile to PDF directly
$ pdflatex [document.tex]
copy
Compile with XeLaTeX
$ xelatex [document.tex]
copy
Compile with LuaLaTeX
$ lualatex [document.tex]
copy
Continuous compilation
$ latexmk -pvc [document.tex]
copy
Clean auxiliary files
$ latexmk -c
copy

SYNOPSIS

latex [options] file
pdflatex [options] file

DESCRIPTION

LaTeX is a document preparation system for high-quality typesetting. It's the standard for scientific papers, theses, and technical documentation.
Common engines: pdflatex (traditional), xelatex (Unicode/modern fonts), lualatex (Lua scripting). Most documents use pdflatex or lualatex.

PARAMETERS

-interaction mode

Interaction mode: nonstopmode, batchmode.
-output-directory dir
Output directory.
-shell-escape
Enable shell commands.
-synctex n
Generate SyncTeX data.
-halt-on-error
Stop on first error.

DOCUMENT STRUCTURE

$ \documentclass{article}
\usepackage{amsmath}

\title{My Document}
\author{Author Name}

\begin{document}
\maketitle

\section{Introduction}
Content here.

\end{document}
copy

CAVEATS

Multiple compilations often needed for references. Bibliography requires bibtex/biber run. Use latexmk for automation.

HISTORY

LaTeX was created by Leslie Lamport in the 1980s as a set of macros for TeX (created by Donald Knuth in 1978). It remains the standard for academic publishing.

SEE ALSO

pdflatex(1), bibtex(1), latexmk(1), texdoc(1)

Copied to clipboard