Skip to article
Documentation

Build and preview

Compile a document locally and navigate between source and PDF.

On this page

Create a small document#

Create main.tex:

\documentclass{article}
\begin{document}
\section{Hello}
A document built inside the IDE.
\end{document}

Use LaTeX: Build, or create a LaTeX run configuration. With a working backend, the build produces a PDF and navigable diagnostics. Click a compiler error to open the relevant source line.

Choose a backend#

For a conventional TeX distribution, select latexmk and pdfLaTeX, XeLaTeX, or LuaLaTeX. latexmk manages reruns and bibliography passes. Tectonic is an alternative with its own dependency cache. Direct-engine builds invoke the selected engine and use the configured build pipeline.

For a multi-file document, right-click its root and choose Mark as LaTeX Main File. Included files can declare % !TeX root = ../main.tex; the path is relative to the file containing the comment. Keep it within the project.

Read the PDF alongside the source#

Use LaTeX: Preview or open the generated PDF. Enable continuous rebuilding to refresh after edits. Choose single-page or continuous-document display and adjust zoom. If compilation fails, fix the error before treating the visible PDF as current.

Enable Generate SyncTeX data, rebuild, then use LaTeX: Forward Search at the source caret. Reverse-search interactions in the PDF return to source. The PDF and generated mapping must describe the same build.

Manual for version 2026.1.14 · Reviewed