How to compile LaTeX code to PDF
LaTeX source becomes a PDF through compilation — a TeX engine reads your commands and typesets pages. This page shows the shortest path: real pdfLaTeX running in your browser.
Compile, don’t convert
You will see the phrase “LaTeX converter” around the web. It misleads: there is no format conversion happening. An engine — pdfLaTeX is the default — interprets your source and typesets it: it breaks lines, places floats, renders math, numbers sections and resolves \ref/\cite references across passes. The output is exactly what a local TeX installation would produce.
Compile in the browser
- Open the LaTeX → PDF page.
- Paste your code or keep the example.
- Press Compile. The engine and any packages your document needs download once, then stay cached.
- Download the PDF when it is ready.
What a complete document needs
Real documents rarely fit in one pass. A paper with a bibliography needs:
- a pdfLaTeX pass — writes .aux with citation keys;
- a BibTeX pass — turns the keys and your .bib file into a formatted bibliography;
- one or two more pdfLaTeX passes — settles citation numbers and cross-references.
texviewer runs that sequence for you when the document uses \bibliography — the article template demonstrates it.
When compilation fails
Failures are normal and always carry a line number. The frequent ones each get a short guide:
- Undefined control sequence — a command the engine does not know.
- Missing $ inserted — math markup outside math mode.
- File not found — a missing figure, input or package.