Keybinding Note: This extension uses Emacs-style keybindings where Ctrl is used on all platforms (not Cmd on Mac), except where explicitly noted.
✅ Document Outline
The outline view (VS Code's built-in outline panel Cmd/C-Shift-o) shows the structure of your LaTeX document:
Sections (part, chapter, section, subsection, etc.)
Labeled Environments (figures, tables, equations with labels)
Labels for cross-referencing
The outline uses hierarchical nesting to show the document structure. Click any item to jump to it.
✅ Section Hierarchy
LaTeX sections are organized hierarchically:
| Level | Command | Symbol Kind |
|---|---|---|
| 0 | \part | Module |
| 1 | \chapter | Class |
| 2 | \section | Method |
| 3 | \subsection | Function |
| 4 | \subsubsection | Field |
| 5 | \paragraph | Property |
| 6 | \subparagraph | Property |
Starred variants (e.g., \section*{...}) are also recognized and marked in the outline.
✅ Structure Editing
Edit the document structure by promoting, demoting, and moving sections.
| Command | Key Binding | Description |
|---|---|---|
| scimax.latex.promoteSection | Alt+Left | Promote section (e.g., sub→sec) |
| scimax.latex.demoteSection | Alt+Right | Demote section (e.g., sec→sub) |
| scimax.latex.promoteSubtree | Alt+Shift+Left | Promote section and children |
| scimax.latex.demoteSubtree | Alt+Shift+Right | Demote section and children |
| scimax.latex.moveSectionUp | Alt+Up | Move section above sibling |
| scimax.latex.moveSectionDown | Alt+Down | Move section below sibling |
| scimax.latex.markSection | C-c @ | Select entire section |
| scimax.latex.killSection | - | Delete section (copy to clip) |
| scimax.latex.cloneSection | - | Duplicate section |
| scimax.latex.insertSection | - | Insert new section at same level |
| scimax.latex.insertSubsection | - | Insert subsection |
✅ Promote/Demote
Change the level of a section command:
% Before promote:
\subsection{Methods}
% After promote (Alt+Left):
\section{Methods}
% Before demote:
\section{Results}
% After demote (Alt+Right):
\subsection{Results}
✅ Promote/Demote Subtree
Promote or demote a section and all its children:
% Before promoteSubtree on "Methods":
\subsection{Methods}
\subsubsection{Data}
\subsubsection{Analysis}
% After promoteSubtree (Alt+Shift+Left):
\section{Methods}
\subsection{Data}
\subsection{Analysis}
✅ Move Section Up/Down
Swap a section with its previous or next sibling:
% Before moveSectionDown on "Introduction":
\section{Introduction}
Content A...
\section{Methods}
Content B...
% After moveSectionDown (Alt+Down):
\section{Methods}
Content B...
\section{Introduction}
Content A...
The entire section subtree (including all nested content) is moved.
Environment Commands
Work with LaTeX environments (\begin{...} / \end{...}):
| Command | Key Binding | Description |
|---|---|---|
| scimax.latex.selectEnvironment | C-c C-e | Select entire environment |
| scimax.latex.selectEnvironmentContent | - | Select content (not begin/end) |
| scimax.latex.changeEnvironment | C-c E | Change environment type |
| scimax.latex.wrapInEnvironment | C-c w | Wrap selection in environment |
| scimax.latex.unwrapEnvironment | - | Remove begin/end, keep content |
| scimax.latex.deleteEnvironment | - | Delete entire environment |
| scimax.latex.toggleEnvironmentStar | C-c * | Toggle starred variant |
| scimax.latex.addLabel | C-c C-l | Add \label to environment |
| scimax.latex.addCaption | - | Add \caption to figure/table |
| scimax.latex.jumpToMatchingEnvironment | C-c % | Jump between \begin and \end |
Change Environment
The changeEnvironment command (C-c E) prompts to change the environment type:
% Before:
\begin{equation}
E = mc^2
\end{equation}
% After changing to "align":
\begin{align}
E = mc^2
\end{align}
Both \begin and \end are updated simultaneously.
✅ Wrap in Environment
Select text and use wrapInEnvironment (C-c w) to surround it:
% Before (with "E = mc^2" selected):
E = mc^2
% After wrapping in "equation":
\begin{equation}
E = mc^2
\end{equation}
✅ Toggle Star
Toggle the starred variant of an environment:
% Before:
\begin{equation}
E = mc^2
\end{equation}
% After toggleEnvironmentStar (C-c *):
\begin{equation*}
E = mc^2
\end{equation*}
✅ Hover Tooltips
Hover over LaTeX elements to see helpful information:
| Element | Information Shown |
|---|---|
\ref{label} | What the label refers to, line number |
\cite{key} | Citation keys (bib integration planned) |
\label{name} | Where label is referenced, context |
\usepackage{pkg} | Package description |
\begin{env} | Environment description |
\section{...} | Section hierarchy path |
\alpha, \beta, etc. | Unicode symbol and description |
\textbf, etc. | Command description |
\input{file} | File path, size, preview |
✅ Reference Hover
Hovering over \ref{fig:example} shows:
The label name
Line number where label is defined
Context (section or environment containing the label)
Preview of the labeled line
✅ Citation Hover
Hovering over \cite{key} shows rich BibTeX information:
Full title
Authors with proper formatting
Year
Journal or book title
Volume, number, pages
DOI (as clickable link)
Abstract preview
Supports all natbib and biblatex citation commands:
\cite,\citep,\citet\citealt,\citealp\citeauthor,\citeyear\nocite
✅ Package Hover
Hovering over \usepackage{amsmath} shows:
Package name
Description of what the package provides
✅ Math Symbol Hover
Hovering over math commands like \alpha shows:
Unicode representation: α
Unicode code point: U+03B1
Description: Greek lowercase alpha
✅ Speed Commands
At the beginning of a section line, single keys trigger commands:
| Key | Action | Key | Action |
|---|---|---|---|
| n | Next section | < | Promote section |
| p | Previous section | > | Demote section |
| f | Next sibling | U | Move section up |
| b | Previous sibling | D | Move section down |
| u | Parent section | m | Mark section |
| j | Jump to section | k | Kill section |
| J | Jump to label | c | Clone section |
| g | First section | i | Insert section |
| G | Last section | I | Insert subsection |
| Tab | Toggle fold | N | Narrow to section |
| S-Tab | Cycle global fold | W | Widen |
| ? | Show speed commands |
Speed commands only activate when cursor is at or before the backslash of a section command.
✅ Using Speed Commands
Place cursor at the start of a section line (column 0 or before
\)Press a single key
The corresponding action executes
Example:
\section{Introduction} % <- Place cursor here, press 'n' to go to next section
^
|__ Cursor position
✅ Folding
LaTeX documents support folding for sections and environments.
| Command | Key Binding | Description |
|---|---|---|
| scimax.org.toggleFold | Tab | Toggle fold at cursor |
| scimax.org.cycleGlobalFold | Shift+Tab | Cycle all folds |
✅ Section Folding
Sections fold from the section command to the next section at the same or higher level:
\section{Introduction}... % <- Folds from here
Content...
\subsection{Background} % <- Included in fold
More content...
\section{Methods} % <- Fold ends before this
✅ Environment Folding
Environments fold from \begin to \end:
\begin{figure}... % <- Folds from here
\includegraphics{...}
\caption{...}
\end{figure} % <- Fold ends here
✅ Global Fold Cycling
Shift+Tab cycles through three states:
OVERVIEW - All sections folded
CONTENTS - Top-level sections visible
SHOWALL - Everything expanded
✅ Compile and Preview
Compile LaTeX documents and view the generated PDF.
| Command | Key Binding | Description |
|---|---|---|
| scimax.latex.compile | C-c C-c | Compile the document |
| scimax.latex.viewPdf | C-c C-v | View PDF (external viewer) |
| scimax.latex.viewPdfPanel | C-c v | View PDF (built-in panel) |
| scimax.latex.compileAndView | C-c C-a | Compile and view PDF |
| scimax.latex.clean | C-c C-k | Clean auxiliary files |
| scimax.latex.syncTexForward | C-c g | SyncTeX forward search |
| scimax.latex.wordCount | - | Count words (approximate) |
| scimax.latex.selectBuildProfile | - | Choose the build profile |
| scimax.latex.showBuildProfile | - | Show the active build profile |
✅ Compilation
The compile command runs the configured LaTeX compiler (default: pdflatex):
Saves the document
Compiles with
-interaction=nonstopmodefor error handlingShows compilation errors with line numbers
Outputs detailed log to the "LaTeX" output channel
Configure the compiler via scimax.latex.compiler setting:
pdflatex(default)xelatexlualatexlatexmk
Build Profiles for TeX Files
A single compiler run is not enough when the document needs BibTeX or Biber.
Build profiles define a named sequence of commands (for example
pdflatex → bibtex → pdflatex → pdflatex), and scimax.latex.compile uses one
automatically when the file names it:
% !SCIMAX build = pdflatex-bibtex
\documentclass{article}
Pick one interactively with Scimax LaTeX: Select Build Profile
(scimax.latex.selectBuildProfile), which inserts that magic comment for you,
and check the active one with Scimax LaTeX: Show Build Profile.
When a profile applies:
Each step is reported in the progress notification, and the notification's cancel button stops the build.
All step output goes to the "LaTeX" output channel, and errors are still parsed for Go to Error / Next Error.
The build is judged successful by whether a PDF was produced, since LaTeX exits non-zero on mere warnings.
Without a profile, compilation falls back to the scimax.latex.compiler
setting described above. Profiles apply to every compile entry point:
C-c C-c, C-c C-a (compile and view), and the PDF panel.
Profiles are shared with org export - the same latex-profiles.json files and
scimax.export.pdf.profiles setting supply them. See
Build Profiles for the profile file
format, substitution tokens, step options, and the built-in profiles.
✅ SyncTeX Support
SyncTeX allows jumping between source and PDF positions.
Forward search (C-c g): Jump from cursor position in source to corresponding PDF location.
Supported PDF viewers:
macOS: Skim (recommended)
Linux: Zathura
Windows: SumatraPDF
Configure via scimax.latex.pdfViewer setting.
✅ Built-in PDF Viewer Panel
For an Overleaf-like experience, use the built-in PDF viewer panel (C-c v):
Opens PDF in a VS Code panel beside your source
Auto-refreshes when you recompile
Zoom controls (+, -, Fit)
Page navigation
Bidirectional sync with text-based highlighting
No external PDF viewer required
This is ideal for side-by-side editing without leaving VS Code.
| Viewer Option | Key | Description |
|---|---|---|
| Built-in panel | C-c v | PDF in VS Code panel (Overleaf-like) |
| External viewer | C-c C-v | Opens in Skim/Zathura/SumatraPDF |
✅ Bidirectional Sync
The built-in PDF viewer supports precise bidirectional synchronization:
Forward sync (TeX → PDF):
Double-click a word in your LaTeX source to jump to that location in the PDF
Or use
C-c C-sto sync the current cursor position to the PDFThe word is highlighted with a yellow flash
Inverse sync (PDF → TeX): Double-click a word in the PDF viewer to jump to the corresponding line in your LaTeX source.
| Key | Action |
|---|---|
| C-c C-s | Sync cursor position to PDF panel |
| C-c g | SyncTeX forward to external viewer |
The forward sync uses SyncTeX coordinates combined with text-layer search to find the exact word you clicked, even if SyncTeX coordinates are imprecise.
✅ Debug Popup Setting
To see SyncTeX coordinates and debug information when syncing:
{
"scimax.latex.showSyncDebugPopup": true
}
Default is false. When enabled, shows a popup with page, coordinates,
source line/column, and search text for troubleshooting sync issues.
✅ Auto-Compile on Save
When the PDF panel is open, saving a LaTeX file automatically recompiles and refreshes the PDF. This provides an Overleaf-like live preview experience.
To disable auto-compile on save:
{
"scimax.latex.autoCompileOnSave": false
}
Default is true.
✅ Insert Commands
Quick insertion of common LaTeX elements:
| Command | Description |
|---|---|
| scimax.latex.insertFigure | Insert figure environment snippet |
| scimax.latex.insertTable | Insert table with booktabs snippet |
| scimax.latex.insertEquation | Insert equation environment |
These commands insert snippets with tab stops for easy navigation.
✅ Go to Definition
Jump to the definition of labels, citations, commands, and files:
| Trigger | What it does |
|---|---|
\ref{label} | Jump to the \label{label} definition |
\cite{key} | Jump to the BibTeX entry in the .bib file |
\input{file} | Open the included file |
\mycommand | Jump to \newcommand or \def definition |
Use F12 or Ctrl+Click (standard VS Code "Go to Definition").
Supports cross-file navigation in multi-file projects.
✅ Find All References
Find all usages of a label or citation:
| Position on | Shows all |
|---|---|
\label{name} | All \ref{name} references |
\cite{key} | All citations of that key |
Use Shift+F12 or right-click → "Find All References".
Works across all files in the project.
✅ Auto-Completion
Smart completions trigger as you type:
| Context | Completions |
|---|---|
\ref{ | All labels in project with context |
\cite{ | All BibTeX keys with author/year/title |
\begin{ | Common environments (equation, figure, etc.) |
\usepackage{ | Common packages with descriptions |
\includegraphics{ | Image files (.png, .jpg, .pdf, etc.) |
\input{ | .tex files in directory |
Completions show:
Label completions include file name and line context
Citation completions show author, year, and title
Environment completions include descriptions
Package completions describe what each package provides
✅ Multi-File Project Support
Projects with multiple files (using \input or \include) are fully supported:
Master document detection: Automatically finds the main .tex file
Cross-file labels: Complete and navigate labels defined in any project file
Shared bibliography: Finds .bib files referenced anywhere in project
Project-wide search: Find References searches all included files
The master document is detected by looking for \documentclass.
✅ Project Structure
thesis/
├── main.tex # Master document (has \documentclass)
│ └── \input{chapters/intro}
│ └── \input{chapters/methods}
│ └── \bibliography{refs}
├── chapters/
│ ├── intro.tex # \label{sec:intro} defined here
│ └── methods.tex # \ref{sec:intro} works here too
└── refs.bib # Bibliography
✅ ChkTeX Linting
Real-time linting with ChkTeX catches common LaTeX issues:
Missing or extra braces
Spacing issues
Style recommendations
Errors appear in the Problems panel and as squiggles in the editor.
✅ Configuration
{
"scimax.latex.enableChktex": true // Enable/disable linting (default: true)
}
Requires chktex to be installed:
macOS:
brew install chktexLinux:
apt install chktexWindows: Included with MiKTeX/TeX Live
✅ Hover Previews
Hover over LaTeX elements to see previews and information.
✅ Equation Preview
Hover over any math expression to see a rendered preview:
Inline math:
$E=mc^2$,\(E=mc^2\)Display math:
$$...$$$,\[...\]Environments:
equation,align,gather, etc.
The preview:
Renders using the system LaTeX installation
Respects document preamble (packages, custom commands)
Adapts to dark/light VS Code theme
Shows the source LaTeX below the preview
Note: Requires a LaTeX installation (TeX Live, MiKTeX, or MacTeX).
✅ Figure Preview
Hover over \includegraphics{...} to see:
Image preview (PNG, JPG, SVG, GIF, WebP)
File path and size
Last modified date
PDF and EPS files show file information without preview.
✅ Rename Symbol
Rename a label and automatically update all references across the project:
Place cursor on a
\label{name}or\ref{name}Press
F2or right-click → "Rename Symbol"Enter the new name
All
\label{}and\ref{}commands using that name are updated
Works across all files in multi-file projects.
✅ Supported Reference Commands
Rename works with all reference variants:
\label{...}- the definition\ref{...},\eqref{...},\pageref{...}\autoref{...},\cref{...},\Cref{...}
✅ Reference Validation
Automatic validation of label references:
| Issue | Severity | Description |
|---|---|---|
| Undefined reference | Error | \ref{name} but no \label{name} |
| Unused label | Warning | \label{name} with no \ref{name} |
Diagnostics appear in the Problems panel and as squiggles in the editor.
✅ Configuration
{
"scimax.latex.validateReferences": true // Enable/disable (default: true)
}
✅ Inverse SyncTeX
Click in PDF to jump back to the corresponding source location.
✅ Setup
Run the command Scimax LaTeX: Show Inverse SyncTeX Command to get the
configuration command for your PDF viewer.
| PDF Viewer | Configuration |
|---|---|
| Skim | Preferences → Sync → Preset: Custom; Command: code |
| SumatraPDF | Settings → Options → Set inverse search command |
| Zathura | Set synctex-editor-command in config |
✅ URI Handler
The extension also registers a URI handler for vscode:// URLs:
vscode://file/path/to/file.tex:42
This allows PDF viewers to communicate directly with VS Code.
✅ Document Formatting
Format LaTeX documents using latexindent:
| Command | Key Binding | Description |
|---|---|---|
| scimax.latex.format | C-c C-q | Format entire document |
✅ Format on Save
Enable automatic formatting when saving:
{
"scimax.latex.formatOnSave": true, // Auto-format on save
"scimax.latex.latexindentPath": "latexindent" // Path to latexindent
}
✅ Requirements
latexindent must be installed:
macOS: Included with MacTeX, or
brew install latexindentLinux:
apt install texlive-extra-utilsorcpanm YAML::Tiny File::HomeDir Unicode::GCStringWindows: Included with MiKTeX/TeX Live
✅ Customization
Create a .latexindent.yaml file in your project to customize formatting rules.
See the latexindent documentation for options.
✅ LaTeX-Aware Spell Checking
The extension provides infrastructure for LaTeX-aware spell checking that skips commands, math, and comments.
✅ Regions Excluded from Spell Check
| Pattern | Example |
|---|---|
| Commands with arguments | \textbf{word} |
| Inline math | $x^2 + y^2$ |
| Display math | $$..$$ and \[..\] |
| Environments | \begin{...}...\end{...} |
| Comments | % comment text |
✅ User Dictionary
Add words to your personal dictionary:
| Command | Description |
|---|---|
| scimax.latex.addToDictionary | Add word at cursor to dictionary |
The dictionary is stored per-workspace and persists across sessions.