Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>mTeX for VSCodeNew to Visual Studio Code? Get it now.
mTeX for VSCode

mTeX for VSCode

mTeX developers

|
5 installs
| (0) | Free
Read LaTeX beside your VS Code editor with a bundled offline reader and two-way source navigation.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

mTeX for VSCode

Read LaTeX beside its source, including changes you have not saved. The VSIX contains the reader, compiler worker, styles and math fonts. No separate server, TeX distribution, Node.js installation or Git installation is needed to use it.

  1. Install mTeX-for-vscode-0.2.3.vsix using Extensions → … → Install from VSIX…. Build it from the mtex checkout with pnpm vscode:package.
  2. Open and trust your LaTeX project folder, then open a .tex file.
  3. Click mtex: Open Reader to the Side in the editor's title bar, or run that command from the command palette.

The reader opens in a new tab in the adjacent editor group, keeping existing source and reader tabs. Opening the same main document again reuses its reader and reading position. Use mtex: Open Another Reader for a separate tab, or mtex: Open Reader in Browser for a private live reader that also follows unsaved changes. A standalone .tex file also works; its containing directory becomes the source boundary.

The Marketplace extension ID is mTeXdevelopers.mTeX-for-vscode. After publication, install it with code --install-extension mTeXdevelopers.mTeX-for-vscode.

If you installed the earlier mtex.mtex-preview or mTeXdevelopers.mTeX package, uninstall it before installing this extension: they register the same reader commands.

  • Editor → reader: put the cursor in the source and press Ctrl+Alt+J (Cmd+Alt+J on macOS), or use mtex: Show in Reader in the context menu. The reader reveals the corresponding block and opens collapsed ancestors. A new tab starts at the cursor when it points to rendered content. Switching between tabs preserves the current reading position. A long explicit jump leaves a Jump back marker beside the scrollbar.
  • Reader → editor: double-click a source-mapped paragraph or equation. VS Code opens its file and places the cursor at the mapped source position.
  • Close: run mtex: Close Reader, or close its tab. Other readers stay open and continue updating.

Included files, local macro packages and bibliographies use their current editor buffers. Edits are sent directly through VS Code's message API, without server polling. The extension never saves source files, changes Git history or adds a managed mtex project. Saving remains under your control in VS Code.

The source that opened the reader is its entry candidate. If there is a nearby main.tex, choose between it and the source in the picker. mtex: Entry File overrides this, and TeX root comments select an entry when there is no main.tex. Symlinks, outside paths, tool/build directories and generated PDF/auxiliary files are excluded. The reader accepts large files and image collections within available memory. The compiler bounds recursive and repeated input expansion.

Source navigation uses mtex's HTML source maps at rendered block boundaries, including CRLF/Unicode and included files. Pending/stale previews cannot select old offsets in a newly edited buffer. Wait for the preview to update and try again if needed. PDF SyncTeX files are not required.

Readers start in Compact view at every window width: the header and status bar disappear, the outline sits beside the prose in wide groups or above it in narrow groups, and clicked footnotes, citations and quick views open in stacked cards at the bottom right. Focus the reader and press > (Shift+.) to toggle Compact view in its command palette. Your explicit choice survives resizing and webview reloads, and takes precedence over the default. To start new readers in regular view, turn off mtex: Compact Mode By Default in VS Code settings, or add "mtex.compactModeByDefault": false to your user or workspace settings. Readers without an explicit palette choice follow changes to this setting immediately, without recompiling the document.

Select Compact side outline in the reader palette to choose On, Off, or Auto in the right panel. Auto is the default and shows the full side outline when there is room. On keeps it beside the prose; Off uses the compact Contents bar at any width. Other compact features stay enabled. This choice survives webview reloads. Vertical guides in the expanded outline and All sections make heading depth easier to follow.

Open equation quick views stay open while you edit, updating their formulas and numbers after the preview catches up. Labels and source positions keep them on the same target when earlier equations are inserted. Removing a target closes its card; edits do not reopen cards you have dismissed.

Right-click prose and choose Add bookmark to keep a numbered marker beside the scrollbar. It follows the passage while visible and pins to the top or bottom corner while you read elsewhere. Click its icon to return, or × to remove it. Multiple bookmarks are supported; they survive unsaved edits and closing/reopening the reader, using local extension storage without changing your TeX files. Right-click a marker (or focus it and press Shift+F10) to set a text label and choose a color. Hovering shows its label; labels and colors survive reloads too. Small prose corrections retain places when their context is unambiguous.

The outline, notes, references, reading-width/font controls, themes and Beamer presentations work inside the reader. Source editing stays in VS Code. The regular mtex server app remains available independently; the old Server URL setting is no longer needed.

Press ? (Shift+/) while reading to find highlights, underlines and remarks. To keep marks with the project, set "mtex.annotations.storage": "project". The reader saves per-document annotation files under .mtex/annotations/. Choose Color theme in the reader palette to set its appearance. Set custom colors on mtex.reader.colors and font families on mtex.reader.fonts. Configured colors apply across built-in themes. The bundled KaTeX fonts give consistent Latin typography across machines. Set CJKserif inside mtex.reader.fonts to choose an installed CJK serif family independently of serif. The full guide has a settings example.

Press ! (Shift+1) in the reader to open Diagnostics, including in compact view. The tab lists errors, warnings and document statistics for the current preview, including unsaved edits. Use Enter on an issue to open its source location in VS Code.

From the reader palette, enable developer mode and select Measure typing to render latency to log each measured edit in VS Code's mtex Reader output channel.

Standard text sizes (\tiny through \Huge) and extra line spacing such as \\[2em] work in the reader, notes, quick views and exports. Use braces to scope a size declaration: {\huge Larger text} Normal text.

For a Beamer document, run mtex: Enter Presentation Mode in VS Code's command palette, use the play action on the reader tab, or focus the reader and choose Enter presentation mode from its > palette. The native command opens the reader if needed and waits for the current unsaved buffers to be ready. Present slides inside the reader tab with arrow/Page Up/Page Down keys and the progress, aspect-ratio and font controls. Escape restores the reading layout, including compact view. Fullscreen is optional and depends on the webview host; no separate browser or server is required.

Choose Export HTML or Export PDF in the reader's command palette (>), or use mtex: Export HTML / mtex: Export PDF (via Browser) in VS Code's command palette. HTML saves a complete offline file, including accepted unsaved edits, math, images, fonts and Beamer presentation mode. PDF opens an offline copy in your default browser; choose Save as PDF in its print dialog, or use the page's Print / save PDF control if automatic printing is blocked. No server, Chromium bundle or TeX installation is needed. Source files and Git are untouched; private comments and personal annotations are excluded. Private print pages are removed on extension shutdown. Remote-host browser opening depends on that host's setup; HTML can be copied to a local machine and printed there.

See the complete guide for setup, multi-file behavior and development checks.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft