LaTeX in VSCode 2026: LaTeX Workshop Complete Setup
Learn how to set up LaTeX Workshop in VSCode for seamless thesis and research paper writing. This guide covers installation, auto-compilation, live PDF preview, and bibliography management—all without terminal headaches.
Set Up LaTeX in VSCode Without Terminal Headaches — For Researchers & Students Writing Theses
You’ve started a thesis, research paper, or technical document. You open VSCode—your favorite editor—but LaTeX won’t compile. You’re stuck toggling between a terminal window, a PDF viewer, and your editor. The setup feels fragmented, slow, and error-prone.
What if you could write, compile, and preview your LaTeX document all in one place?
That’s what LaTeX Workshop does. This guide gets you from zero to a working LaTeX environment in 15 minutes—no terminal wrestling required.
What You’ll Get
LaTeX Workshop transforms VSCode into a complete LaTeX IDE. It handles compilation, PDF preview, auto-complete, error detection, and AI-assisted fixes—all without leaving your editor. By the end, you’ll have:
- Auto-compile on save (or on-demand builds)
- Live PDF preview in a side panel
- Inline error detection with one-click fixes
- Bibliography management with BibTeX/Biber
- Image and figure support with auto-scaling
No separate tools. No context switching. Write, save, and see your PDF update instantly.
Prerequisites
You need three things:
LaTeX Distribution (required)
VSCode (v1.70+) — download here
LaTeX Workshop Extension — free from the VSCode Marketplace
Optional but recommended: Biber or BibTeX (included in most LaTeX distributions) for citations.
Installation & Setup
Step 1: Install Your LaTeX Distribution
Visit latex-project.org/get/ and download the installer for your OS.
Windows/macOS: Run the official installer (MiKTeX or MacTeX). This takes 5–10 minutes and includes all dependencies.
Linux: Use your package manager:
sudo apt-get install texlive-full
Step 2: Verify LaTeX Installation
Open a terminal and run:
pdflatex --version
You should see version information (e.g., “pdfTeX 3.14159265…”). If you get “command not found,” restart your terminal or computer and try again.
Step 3: Install LaTeX Workshop in VSCode
- Open VSCode
- Press
Ctrl+Shift+X(Windows/Linux) orCmd+Shift+X(macOS) to open Extensions - Search for “LaTeX Workshop” by James Yu
- Click Install
- Restart VSCode
You should now see a TeX icon in the left sidebar.
Step 4: Verify the Extension is Active
Click the TeX icon in the left sidebar. You should see sections like “Commands,” “Build,” and “View.” If it doesn’t appear, restart VSCode again.
⚠️ If LaTeX Workshop doesn’t show up: The extension needs to find
pdflatexon your system. Double-check that your LaTeX distribution installed correctly by runningpdflatex --versionin a fresh terminal.
Your First Document
Create a Minimal LaTeX File
Press Ctrl+N to create a new file. Save it as main.tex and paste this:
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{My First LaTeX Document}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
This is my first LaTeX document in VSCode.
\end{document}
Save the file (Ctrl+S).
Build Your Document
Auto-build (default): The extension compiles automatically when you save. Watch the Build section in the LaTeX Workshop panel for status.
Manual build: Click the TeX icon in the sidebar, then click Build LaTeX Project (or press Ctrl+Alt+B).
View the PDF
In the LaTeX Workshop panel, find the View section and click View in VSCode tab. The PDF opens in a new editor tab. As you edit and save, the PDF updates automatically.
Practical Example: A Thesis Chapter with Citations and Figures
Let’s build something realistic: a chapter with bibliography entries and an image.
Step 1: Create a Bibliography File
In your project folder, create references.bib:
@article{Smith2023,
author = {Smith, John and Doe, Jane},
title = {A Study on LaTeX Workflows},
journal = {Journal of Technical Writing},
year = {2023},
volume = {15},
pages = {123--145}
}
@book{Knuth1984,
author = {Knuth, Donald E.},
title = {The TeXbook},
publisher = {Addison-Wesley},
year = {1984}
}
Step 2: Update main.tex with Bibliography Support
Add these lines after \usepackage[utf8]{inputenc}:
\usepackage{graphicx}
\bibliographystyle{plain}
\bibliography{references}
In the document body, add a citation:
\section{Introduction}
According to \cite{Smith2023}, LaTeX workflows are efficient.
\cite{Knuth1984} remains the definitive reference.
Save and build. The extension automatically runs pdflatex → bibtex → pdflatex to resolve citations. Your bibliography will appear at the end of the document.
Step 3: Add an Image
Place an image file (e.g., figure.png) in your project folder. In main.tex, add:
\begin{figure}[h]
\includegraphics[width=0.8\textwidth]{figure}
\caption{My first figure in LaTeX}
\end{figure}
Save and build. If you get an error, LaTeX Workshop will suggest a fix—accept it to auto-add missing packages.
Common Issues & Fixes
“pdflatex not found”
Your LaTeX distribution isn’t installed or not in your PATH. Verify with pdflatex --version. If that fails, reinstall your LaTeX distribution and restart VSCode.
PDF doesn’t update after saving
Check the Build section for errors. If the build succeeded, click View in VSCode tab again to refresh the preview.
Bibliography entries don’t appear
Ensure your .bib file is in the same folder as main.tex and follows standard format. The extension will run BibTeX automatically during the build cycle.
“File not found” for images
Use relative paths: \includegraphics{figure.png} (same folder) or \includegraphics{images/figure.png} (subfolder). Avoid spaces in filenames.
Pro Tips
- SyncTeX: Enable this in LaTeX Workshop settings to click in the PDF and jump to the corresponding line in your
.texfile. - Word Count: Enable word counting in settings to track progress for journal submissions.
- Custom Recipes: Add XeLaTeX or LuaLaTeX recipes in
settings.jsonfor advanced fonts and language support. - Multi-file Projects: Use
\input{chapter1.tex}or\include{chapter1.tex}to split large documents across files. LaTeX Workshop handles the full build cycle.
Next Steps
- Create your first document using the minimal example above
- Experiment with auto-build settings to find your rhythm
- Add a bibliography to test BibTeX integration
- Explore the LaTeX Workshop wiki for advanced configuration
Now that you have a working LaTeX environment in VSCode, what’s your next step—are you starting a thesis, a research paper, or a journal submission? Reply and let me know what you’re building.
What’s your current LaTeX workflow—do you still toggle between terminal and editor, or have you found a better setup?
Comments