Learn LaTeX
44 short lessons, each with examples compiled on the page. Start at the top if LaTeX is new to you, or jump to what you need. For how TeXeR itself works, see the docs.
Getting started
10 lessonsWhat LaTeX is, your first document, and the basics of text, structure, packages, and fixing errors.
- 01What LaTeX isHow a LaTeX source file becomes a PDF, how to read the source, and why people write this way.
- 02Your first documentThe smallest complete document, the preamble and the body, and a title block.
- 03Text formattingBold, italic, typewriter, small caps, and font sizes, and how far each change reaches.
- 04Paragraphs and line breaksBlank lines, line breaks, indentation, the space between paragraphs, and alignment.
- 05Sections and structureNumbered and unnumbered headings, the table of contents, appendices, and the article, report, and book classes.
- 06ListsBulleted, numbered, and description lists, nesting, and custom labels and spacing with enumitem.
- 07Special charactersReserved characters, quotation marks, dashes, accents, non-breaking spaces, and comments.
- 08Packages and the preambleLoading packages, package and class options, the packages most documents need, and the order to load them in.
- 09Errors and debuggingHow to read a TeX error, the ten most common errors and their fixes, the warnings that matter, and how to find the faulty line.
- 10Multi-file projectsSplitting a document with \input and \include, compiling selected chapters, paths, and a folder layout for a thesis.
Mathematics
11 lessonsTypeset formulas, from a single inline symbol to aligned, numbered, and cross-referenced equations, matrices, theorems, and proofs.
- 01Math basicsWrite inline and display math, number an equation, and put words inside a formula.
- 02Fractions, roots, and exponentsWrite superscripts, subscripts, fractions, roots, and binomial coefficients at the size you want.
- 03Symbols and Greek lettersLook up the commands for Greek letters, operators, relations, arrows, set and logic symbols, and dots.
- 04Aligning equationsLine up equations at a relation, break a long equation across lines, and write piecewise definitions.
- 05MatricesTypeset matrices with any delimiter, add dots, draw augmented matrices, and fit small matrices into text.
- 06Brackets and delimitersSize parentheses, brackets, braces, bars, and angle brackets automatically or by hand.
- 07Sums, integrals, and limitsWrite sums, products, integrals, and limits, and control where their bounds are placed.
- 08Math fontsUse blackboard bold, calligraphic, Fraktur, bold, and upright letters, and define named operators.
- 09Theorems and proofsDeclare theorem, lemma, and definition environments, style and number them, and write proofs.
- 10Numbering and referencing equationsLabel equations and refer to them, choose which ones are numbered, and change the form of the numbers.
- 11Spacing in mathAdd or remove space in a formula where automatic spacing falls short, and leave it alone elsewhere.
Figures, tables, and references
10 lessonsPlace images and tables, number and cite them, and build bibliographies, links, contents, and indexes.
- 01ImagesInclude an image file, size it without distortion, rotate it, and crop it.
- 02Figures and captionsGive an image a numbered caption, control where it is placed, and set figures side by side.
- 03TablesBuild a table with tabular, rule it with booktabs, caption it, and align numbers on the decimal point.
- 04Advanced tablesMerge cells, wrap text in columns, adjust spacing, color rows, and handle tables that are too long or too wide.
- 05Cross-referencesRefer to sections, figures, tables, and equations by label so that numbers and pages stay correct.
- 06Bibliography with BibTeXKeep sources in a .bib file, cite them by key, and print a reference list in the style you choose.
- 07Bibliography with biblatexProduce citations and a reference list with biblatex and Biber, and decide when to prefer it to BibTeX.
- 08Footnotes and margin notesAdd footnotes, make them work in tables and headings, and put short notes in the margin.
- 09HyperlinksLink to web pages and to places in your document, style the links, and set the PDF's title and author.
- 10Contents, lists, and indexesPrint a table of contents and lists of figures and tables, choose what they include, and add an index and a glossary.
Layout, slides, and drawing
13 lessonsPage layout, fonts, color, and spacing, then code listings, your own commands, slides, diagrams, plots, a thesis, and other languages.
- 01Page layoutPaper size, orientation, and margins with geometry, two-sided documents, and landscape pages.
- 02Headers and footersPage styles, custom headers and footers with fancyhdr, page numbering, and a different first page.
- 03Fonts and sizesFont families, changing the document font, text sizes, font encoding, and system fonts with fontspec.
- 04ColorsColored text, boxes, table rows, and pages with xcolor, and how to define your own colors.
- 05SpacingLine spacing, paragraph spacing, exact horizontal and vertical gaps, units, and stretchable space.
- 06ColumnsTwo-column documents, multicol for part of a page, column breaks and balancing, and full-width figures.
- 07Code listingsVerbatim text, highlighted and numbered code with the listings package, and why minted does not run here.
- 08Custom commandsYour own commands and environments with \newcommand, \renewcommand, and \newenvironment, and when to define one.
- 09Presentations with beamerSlides with the beamer class: frames, a title slide, step-by-step overlays, blocks, themes, and columns.
- 10Drawing with TikZDiagrams with TikZ: coordinates and paths, shapes, nodes and labels, arrows, styles, and a complete flowchart.
- 11Plots with pgfplotsGraphs of functions and data with pgfplots: the axis environment, labels, legends, several plots, and styling.
- 12Thesis structureThe report and book classes, front and main matter, chapters in separate files, appendices, and the back matter.
- 13Languages and UnicodeUTF-8 input, babel and language switching, hyphenation, quotation marks with csquotes, and right-to-left and CJK text.