Streamlining LaTeX Workflow with VSCode: An Essential Guide
Installing TeX Live
Download the ISO Image
Download the latesttexlive2025.iso(≈6GB) from a nearby CTAN mirror .Installation Steps
- Extract the ISO file and run
install-tl-windows.batas Administrator. - Choose a custom installation path (default:
C:\, butD:\is recommended to save space).
- If needed, it can be further customized by
Advanced options.
- Unnecessary components can be disabled (e.g., TeXworks frontend).
- Installation may take 30–60 minutes.
- Extract the ISO file and run
Verify Installation
Open Command Prompt (Win + R→cmd) and run:Version details confirm a successful installation.
Configuring VSCode
- Install Extensions
Search and install these extensions in VSCode:- LaTeX Workshop (core plugin for compiling/previewing)

- The default settings are saved in
defaultSettings.json
- Set Up Compilation
Opensettings.jsonin VSCode (Ctrl + Shift + P→Preferences: Open User Settings (JSON)) and add:
| |
Integrating Sumatra PDF
Install SumatraPDF
- Download the portable version from SumatraPDF (≈10MB).
Configure Inverse Search (optional) In SumatraPDF,
Settings–>Options–>Set inverse search command-line, fill in1"C:\Users\seekz\AppData\Local\Programs\Trae\Trae.exe" "C:\Users\seekz\AppData\Local\Programs\Trae\resources\app\out\cli.js" -r -g "%f:%l"Alternatively, specify inverse search parameters directly in
Advanced options, i.e.,SumaraPDF-settings.txt1InverseSearchCmdLine = "C:\Users\seekz\AppData\Local\Programs\Trae\Trae.exe" "C:\Users\seekz\AppData\Local\Programs\Trae\resources\app\out\cli.js" -r -g "%f:%l"Verify Bidirectional Navigation
- Forward Search: Press
Ctrl + Alt + Jin VSCode to jump to the corresponding line in the PDF. - Inverse Search: Double-click text in SumatraPDF to navigate to the LaTeX source code in VSCode.
Testing and Debugging
- Create a Test Document
Createtest.texwith:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40\documentclass{article} \usepackage{amsmath} % For mathematical equations \usepackage{graphicx} % For image handling \title{LaTeX Test Document} \author{Author Name} \date{\today} \begin{document} \maketitle \section{Text Test} This is a sample text for testing purposes. LaTeX is a high-quality typesetting system. \section{Mathematical Equations} Inline equation: $E=mc^2$ Display equation: \[ \sum_{i=1}^{n} i = \frac{n(n+1)}{2} \] \section{List Example} \begin{itemize} \item First item \item Second item \item Third item \end{itemize} \section{Table Example} \begin{tabular}{|l|c|r|} \hline Left & Center & Right \\ \hline 1 & 2 & 3 \\ 4 & 5 & 6 \\ \hline \end{tabular} \end{document} - Compile and Preview
- Save the file (
Ctrl + S), compile and generate the PDF. - View the output in the VSCode preview panel or SumatraPDF.

- Save the file (
Formatting
Download
latexindent.exefrom the GitHub repositoryAdd the folder containing the executable to your system’s PATH environment variable
Configure VSCode by adding the following settings to
settings.json:1 2 3 4 5 6 7 8 9// LaTeX files format // Define the program to format the LaTeX document. // - none: Do not use any formatter. // - latexindent: Use `latexindent` to format the LaTeX document. // - tex-fmt: Use `tex-fmt` to format the LaTeX document. "latex-workshop.formatting.latex": "latexindent", // Define the location of the latexindent executable file. "latex-workshop.formatting.latexindent.path": "latexindent",Format your LaTeX files using the shortcut
Shift + Alt + F
Keyboard Shortcuts
- Default LaTeX Workshop Shortcuts VSCode’s LaTeX Workshop extension comes with built-in shortcuts for common operations:
- Build Document:
Ctrl + Alt + B(Windows/Linux) - Preview PDF:
Ctrl + Alt + V(Windows/Linux) - Forward Search (PDF ↔ Source):
Ctrl + Alt + J(Windows/Linux) - Kill Compilation:
Ctrl + Alt + C(Windows/Linux)
Customizing LaTeX Shortcuts
Step 1: Access Keyboard Shortcuts Configuration
- Press
Ctrl + K→Ctrl + S(Windows/Linux) to open the Keyboard Shortcuts interface - Click the “Open Keyboard Shortcuts (JSON)” icon in the top-right corner to access
keybindings.json
Step 2: Add Custom Shortcuts
Add the following examples to keybindings.json (modify as needed):
- Press
| |