What is TeX / LaTeX

TeX is a typesetting system for setting mathematics, papers, and books beautifully. LaTeX is the practical language built on top of it. This page covers what each one is, and the idea at the heart of both: you write structure, not appearance — a fundamental break from word processors.

What is TeX

Typesetting is an old printing term: arranging metal type to make a printing plate. TeX does this on a computer — it places text and figures precisely and outputs the finished “plate” (today, a PDF). It was created by the computer scientist Donald Knuth, who started building it in 1978 because the mathematics in his book *The Art of Computer Programming* could not be set beautifully with the tools of the day.

It has several practical virtues. It is free and open source — you may inspect it, modify it, and use it commercially. It is deterministic across platforms: the same input gives the same output on Windows, macOS, or Linux. And because the input is plain text, you can write it in any editor and search, reuse, or generate it programmatically.

Above all, its typesetting is meticulous. It automatically handles hyphenation across line breaks, kerning of pairs like AV and To, ligatures that fuse fi and fl into a single glyph, and widow/orphan control that avoids stranding a lone first or last line of a paragraph on its own page. Its mathematical typesetting in particular is the de facto standard for expressing equations as text. (The final “X” is the Greek χ — said “tech” in English, and traditionally “teh” in Japan.)

What is LaTeX

TeX itself is low-level, and almost nobody writes raw TeX. LaTeX is the layer that makes it approachable, built in the 1980s by the computer scientist Leslie Lamport using TeX’s macro (programming) facility.

Its core idea is that you write the logical structure of a document separately from its appearance. To start a section titled “Introduction,” you write only its meaning — \section{Introduction}. The rules that turn that into a look (“14pt bold, flush left, so much space above and below…”) live in a separate class file or style file.

So by swapping the class file you can render the same manuscript in a completely different style — handy for matching each journal’s submission rules. Hard-coding “14pt, centered” into the body instead means editing the whole document every time the design changes, with headings drifting out of sync and reuse becoming painful. It is exactly the relationship between HTML and CSS on the web.

LaTeX also numbers your chapters, sections, figures, tables, and equations; inserts the right number or page at each cross-reference; and builds the table of contents, index, and bibliography for you. This convenience is why usage exploded — and why “using TeX” almost always means using LaTeX.

For Japanese, the pTeX engine and pLaTeX on top of it have long been standard (today LuaLaTeX is a strong choice too). LaTeX is the norm in the sciences: the preprint server arXiv recommends LaTeX submissions, reference works such as the *Iwanami Encyclopedia of Mathematics* are typeset in it, and even Wikipedia writes its equations in LaTeX syntax (rendered to images).

Write, then compile

You write a plain-text .tex file with commands in it, then compile it with a TeX engine to produce a PDF (usually twice, so cross-references and the table of contents resolve). Unlike a word processor that repaints the page on every keystroke (WYSIWYG), TeX processes the whole document at once. The full pipeline is covered on the “From source to PDF” page.

A minimal example

Here is the smallest LaTeX document that compiles. \documentclass picks the kind of document; everything between \begin{document} and \end{document} is the body. The thing to remember: line breaks in the source do not matter — a blank line starts a new paragraph. Wherever you break lines, LaTeX decides the final line breaks itself.

document.tex
\documentclass{article}
\begin{document}
Hello, \LaTeX! Here is an equation:
\[ E = mc^2 \]
\end{document}

Compiling this yields a PDF with the line “Hello, LaTeX!” followed by the equation E = mc² set neatly on its own centered line.

TeX vs LaTeX vs pLaTeX / upLaTeX / LuaLaTeX

The names multiply, but the trick is to separate “engine” from “format.” The engine is the program that does the work (TeX, pdfTeX, XeTeX, LuaTeX); the format is the system of commands (LaTeX). Their combinations are pdfLaTeX, XeLaTeX, and LuaLaTeX — and LaTeX on the Japanese-capable engines pTeX/upTeX gives pLaTeX and upLaTeX.

NameWhat it isReach for it when
pdfLaTeXLaTeX on the pdfTeX engine; the classic defaultYou write mostly English / European text
upLaTeXJapanese LaTeX on upTeX (Unicode-aware)The standard for Japanese papers
LuaLaTeXLaTeX on LuaTeX; system fonts, Unicode, LuaModern setups; Japanese via luatexja
XeLaTeXLaTeX on XeTeX; system fonts, UnicodeYou want easy OpenType fonts

If unsure: for Japanese, upLaTeX or LuaLaTeX; for mostly-English, pdfLaTeX; to use the fonts already on your system, LuaLaTeX or XeLaTeX. Starting fresh in Japanese? LuaLaTeX is a safe default.

Why use LaTeX

  • Beautiful mathematics. Nothing else sets math as well.
  • Focus on structure. Appearance is the class file’s job; the body carries only meaning.
  • Everything lines up. Numbering, cross-references, the table of contents, the index, and the bibliography are generated for you.
  • Scales up. Theses, books, and long papers stay consistent.
  • Plain text. Diff it with Git; reproducible and future-proof.
  • Free and vast. Open source, with a huge package ecosystem on CTAN.

That said, for short notes, flyers, real-time collaborative editing, or pixel-perfect graphic design, a WYSIWYG tool can be faster. Use the right tool for the job.