Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>LaTeX Section Number HintsNew to Visual Studio Code? Get it now.
LaTeX Section Number Hints

LaTeX Section Number Hints

LordElias

| (0) | Free
Shows compiled LaTeX section numbers as inlay hints in source files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LaTeX Section Number Hints

See your PDF’s section numbers right in VS Code.

Latest release CI MIT license

VS Code showing shaded inlay hints for LaTeX section 2 and subsections 2.1 and 2.2

The shaded numbers mark each heading’s place in the compiled document.

When a reviewer points to section 2.2, you can spot the number beside the heading in your .tex file. The extension reads numbering from LaTeX’s .toc or .aux and displays it as editor-only inlay hints.

Hints appear on unstarred \part, \chapter, \section, \subsection, and \subsubsection commands whose titles match the compiled output.

AI disclosure

This project was created using AI agents, including the extension code, tests, documentation, and icon.

Install in VS Code

  1. Download the .vsix under Assets in the latest GitHub release.
  2. In VS Code, run Extensions: Install from VSIX… from the Command Palette and select the downloaded file.

Requirements

  • Compile the document once so a .toc or .aux exists.
  • editor.inlayHints.enabled must be on.

Root and TOC discovery

Root file, first match wins:

  1. latexSectionNumberHints.rootFile
  2. %!TEX root = ../main.tex
  3. Nearest main.tex in a parent directory (up to the workspace folder)
  4. The current file

TOC file: latexSectionNumberHints.tocFile if set. Otherwise <root>.toc, then <root>.aux, each searched in:

  1. LaTeX Workshop latex-workshop.latex.auxDir and latex-workshop.latex.outDir
  2. <root dir>/.latex-build/
  3. <root dir>/

The .aux fallback works without \tableofcontents and follows \included .aux files.

Settings

Setting Default Description
latexSectionNumberHints.enabled true Enable hints.
latexSectionNumberHints.rootFile "" Root .tex, relative to workspace folder.
latexSectionNumberHints.tocFile "" .toc or .aux path, relative to root directory. Supports %DIR%, %DOCFILE%, ${workspaceFolder}.

Commands

  • LaTeX Section Number Hints: Refresh
  • LaTeX Section Number Hints: Show Status

Development

npm install
npm test        # lint, type-check, tests
npm run vsix    # build installable .vsix

Press F5 to launch an Extension Development Host.

Path Purpose
src/latex.ts Source/TOC parsing and matching (no VS Code dependency)
src/paths.ts Path resolution helpers
src/extension.ts Inlay hint provider, commands, file discovery
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft