LaTeX Section Number Hints
See your PDF’s section numbers right in VS Code.

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
- Download the
.vsix under Assets in the latest GitHub release.
- 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:
latexSectionNumberHints.rootFile
%!TEX root = ../main.tex
- Nearest
main.tex in a parent directory (up to the workspace folder)
- The current file
TOC file: latexSectionNumberHints.tocFile if set. Otherwise <root>.toc, then <root>.aux, each searched in:
- LaTeX Workshop
latex-workshop.latex.auxDir and latex-workshop.latex.outDir
<root dir>/.latex-build/
<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 |