Installation Guide

VS Code + Claude Code + LaTeX

Set up your AI-assisted technical writing environment: Visual Studio Code with the Claude Code extension, and a working LaTeX distribution (pdflatex).

Prerequisites 1. VS Code 2. Node.js 3. Claude Code 4. Claude Code Extension 5. LaTeX (pdflatex) 6. LaTeX Workshop 7. Verify Everything
Prerequisites

Make sure you have the following before you begin.

💻
Operating System
macOS 13+  |  Windows 10+
💾
Disk Space
~5 GB (LaTeX is the largest)
🌐
Internet
Stable connection required
🕑
Claude Subscription
Claude Pro or Max plan
🔨 Part 1: Install Visual Studio Code

Download and install VS Code for your operating system.

📦

Download Visual Studio Code

1

Go to the VS Code website

Visit code.visualstudio.com and click the download button for your OS.

2

Install VS Code

macOS: Open the downloaded .dmg file and drag Visual Studio Code to your Applications folder.

Windows: Run the downloaded .exe installer and follow the setup wizard. Check “Add to PATH” when prompted.

3

Launch VS Code

Open Visual Studio Code from your Applications (macOS) or Start Menu (Windows) to verify it works.

📦 Part 2: Install Node.js

The Claude Code CLI requires Node.js 18 or higher.

🌱 macOS
📱 Windows
🌱

Install Node.js on macOS

1

Download Node.js

Visit nodejs.org and download the LTS version (20 or later recommended).

2

Install and verify

Open the downloaded .pkg file and follow the installer. Then open Terminal and verify:

terminal
node --version
💡 You should see a version number like v20.x.x or higher.
📱

Install Node.js on Windows

1

Download Node.js

Visit nodejs.org and download the LTS version (20 or later recommended).

2

Install and verify

Run the .msi installer and follow the setup wizard. Then open Command Prompt and verify:

cmd
node --version
🤖 Part 3: Install Claude Code

Install Claude Code globally via npm.

🔌

Install Claude Code via npm

1

Open your terminal

macOS: Press Cmd + Space, type Terminal, and press Enter.

Windows: Press Win, type cmd, and click Open.

2

Install Claude Code globally

terminal
npm install -g @anthropic-ai/claude-code
macOS: Do not use sudo. Windows: Do not run Command Prompt as Administrator. Both can cause permission issues.
3

Authenticate

Run claude for the first time. Your browser will open for a one-time sign-in.

terminal
claude

Log in with your Claude.ai account (Pro or Max plan).

4

Verify the installation

terminal
claude doctor
💡 claude doctor checks your installation type, version, and connectivity. All items should show green.
🔌 Part 4: Install the Claude Code Extension

Add the Claude Code extension to Visual Studio Code.

🔌

Install Claude Code Extension in VS Code

1

Open VS Code

Launch Visual Studio Code on your computer.

2

Open the Extensions panel

Click the Extensions icon in the left sidebar, or press:

Cmd + Shift + X (macOS)  /  Ctrl + Shift + X (Windows)

3

Search for “Claude Code”

Type Claude Code in the search bar. Look for the official extension by Anthropic.

4

Install the extension

Click the Install button on the Claude Code extension.

Make sure it is the official extension published by Anthropic.
5

Authenticate with your Claude account

After installation, open the Claude Code panel in VS Code. It will prompt you to sign in. Your browser will open for a one-time authentication.

Log in with your Claude Pro or Max plan account.

6

Verify the setup

After signing in, the Claude Code panel should show a chat interface inside VS Code.

💡 You can open the Claude Code panel anytime using Cmd + Shift + P (macOS) / Ctrl + Shift + P (Windows) and typing “Claude Code”.
📝 Part 5: Install LaTeX (pdflatex)

Install a LaTeX distribution so that the pdflatex command works in your terminal. This is required for compiling research papers.

🌱 macOS
📱 Windows
🌱

Install MacTeX on macOS

1

Download MacTeX

Go to tug.org/mactex and download MacTeX.pkg (full distribution, ~5 GB).

Prefer a smaller install? Use BasicTeX (~100 MB), then add packages with tlmgr.
2

Run the installer

Open the downloaded .pkg and follow the installer. MacTeX adds pdflatex, bibtex, latexmk, and other tools to /Library/TeX/texbin.

3

Restart your terminal

Quit and reopen Terminal so it picks up the updated PATH. Then verify:

terminal
pdflatex --version
💡 You should see a line like pdfTeX 3.141592653-2.6-1.40.xx (TeX Live 20XX).
If pdflatex: command not found, ensure /Library/TeX/texbin is on your PATH. You can append this line to ~/.zshrc: export PATH="/Library/TeX/texbin:$PATH" — then run source ~/.zshrc.
📱

Install MiKTeX on Windows

1

Download MiKTeX

Go to miktex.org/download and download the Basic MiKTeX Installer for Windows (basic-miktex-x64.exe).

Prefer TeX Live? Download from tug.org/texlive. Either distribution provides pdflatex.
2

Run the installer

Launch the .exe installer and follow the setup wizard. When asked, choose:

  • “Install MiKTeX for: Anyone who uses this computer” (recommended)
  • Preferred paper: Letter or A4
  • Install missing packages on the fly: Yes
3

Update MiKTeX (recommended)

After installation, open MiKTeX Console from the Start Menu and click Check for updates. Apply any pending updates.

4

Restart Command Prompt

Close and reopen Command Prompt so it picks up the new PATH. Then verify:

cmd
pdflatex --version
💡 You should see a line like MiKTeX-pdfTeX 4.x (...).
If pdflatex is not recognized, the installer may not have added MiKTeX to your PATH. Reopen the installer and choose “Modify”, or add C:\Users\<you>\AppData\Local\Programs\MiKTeX\miktex\bin\x64 to your system PATH manually.
📝 Part 6: Install LaTeX Workshop in VS Code

Required to compile and preview .tex files directly inside VS Code.

🔌

Install LaTeX Workshop Extension

1

Open the Extensions panel in VS Code

Cmd + Shift + X (macOS)  /  Ctrl + Shift + X (Windows)

2

Search for “LaTeX Workshop”

Type LaTeX Workshop in the search bar. Look for the extension by James Yu.

Make sure the publisher is James Yu — it has millions of installs and is the de-facto standard.
3

Install the extension

Click the Install button. The extension auto-detects the pdflatex you installed in Part 5.

4

Compile a .tex file

Open a .tex file in VS Code and build it:

  • Click the TeX icon in the Activity Bar (left sidebar) → Build LaTeX project, or
  • Press Cmd + Alt + B (macOS) / Ctrl + Alt + B (Windows).

To open the generated PDF side-by-side, press Cmd + Alt + V (macOS) / Ctrl + Alt + V (Windows).

5

(Recommended) Use pdflatex as the default recipe

By default LaTeX Workshop tries latexmk first. To force pdflatex, open VS Code settings (Cmd/Ctrl + ,), search for latex-workshop.latex.recipe.default, and set it to first after adding this to your settings.json:

settings.json
"latex-workshop.latex.tools": [
  {
    "name": "pdflatex",
    "command": "pdflatex",
    "args": ["-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%"]
  },
  {
    "name": "bibtex",
    "command": "bibtex",
    "args": ["%DOCFILE%"]
  }
],
"latex-workshop.latex.recipes": [
  {
    "name": "pdflatex × bibtex × pdflatex × pdflatex",
    "tools": ["pdflatex", "bibtex", "pdflatex", "pdflatex"]
  },
  {
    "name": "pdflatex",
    "tools": ["pdflatex"]
  }
]
💡 The first recipe handles documents with citations (\cite{...}); the second is faster for documents without bibliography.
Part 7: Verify Everything Works

Run the following commands in your terminal. Each should print a version string.

terminal
# Node.js / npm
node --version
npm --version

# Claude Code CLI
claude --version

# LaTeX
pdflatex --version

As a final smoke test, build a tiny LaTeX document:

terminal
echo "\documentclass{article}\begin{document}Hello AI-Assist Writing!\end{document}" > hello.tex
pdflatex hello.tex
💡 If a hello.pdf is generated, your LaTeX setup is working correctly.