DEV Community

Cover image for Building a Fully Local LaTeX Thesis Workflow with VS Code and MiKTeX
Das
Das

Posted on • Originally published at Medium

Building a Fully Local LaTeX Thesis Workflow with VS Code and MiKTeX

Why I Didn't Use Word

I tried writing in Word at first. It works fine for small documents, but once the thesis started growing, it became harder to manage. Formatting, figures, and updating the table of contents sometimes caused other sections to shift unexpectedly. Fixing small layout issues was taking more time than actual writing.

For a long academic document with references, numbered figures, and strict formatting requirements, I wanted something more structured.

Why I Didn't Use Overleaf Either

Overleaf is the go-to recommendation for LaTeX beginners, it runs in the browser, there's nothing to install, and it has a live PDF preview. For a quick document, it's fine.

But for a full thesis, it has real limitations:

  • For security reasons, you may not want your research or unpublished work stored on a public platform
  • The free tier has limits
  • Your data lives on their servers
  • You can't work offline

The alternative? Run everything locally. Your machine, your files, your Git repository. Free forever. Works offline. Private by default.

The Stack: LaTeX + MiKTeX + VS Code

  • LaTeX — the document preparation system. You write in plain text with markup, and LaTeX produces a perfectly formatted PDF
  • MiKTeX — a LaTeX distribution for Windows that manages all the packages you need, installing them automatically when required
  • VS Code — the code editor, used here as a LaTeX editor with the LaTeX Workshop extension
  • XeLaTeX — the compiler. Better than pdfLaTeX for modern fonts and Unicode
  • Biber — bibliography manager, works with BibTeX .bib files
  • Makeglossaries — handles abbreviation lists and acronyms
  • Python + Pygments — required for the minted package for syntax-highlighted code blocks

Step-by-Step Setup

Before you start: This guide covers Windows. The same tools exist for macOS and Linux with slightly different installation steps.

Step 1: Install MiKTeX

MiKTeX is the LaTeX engine. It comes with XeLaTeX, Biber, and Makeglossaries, and it will automatically download any missing LaTeX packages the first time you compile.

  1. Go to miktex.org/download
  2. Download the Windows installer and run it
  3. Choose Install for all users if you have admin rights, otherwise install for yourself
  4. After installation, open a terminal and verify:
xelatex --version
biber --version
makeglossaries --version
Enter fullscreen mode Exit fullscreen mode

If anything is missing, MiKTeX's package manager can install them.

Screenshot: MiKTeX Console

Screenshot: Terminal showing all three version outputs

Step 2: Install Python and Pygments

The template uses the minted package for code syntax highlighting. Check if Python is already installed:

python --version
pygmentize -V
Enter fullscreen mode Exit fullscreen mode

If not, download from python.org/downloads. Then install Pygments:

pip install pygments
Enter fullscreen mode Exit fullscreen mode

Step 3: Install VS Code and Extensions

  1. Download from code.visualstudio.com
  2. Install and open VS Code
  3. Search and install the LaTeX Workshop extension from the Extensions panel

Screenshot: Required VS Code Extensions

Step 4: Clone the Template and Configure the Compiler

git clone https://github.com/007bsd/metropolia-thesis-latex.git
cd metropolia-thesis-latex
code .
Enter fullscreen mode Exit fullscreen mode

Or download the ZIP from GitHub directly and open the folder in VS Code.

Screenshot: VS Code with the thesis folder open

The project includes a .vscode/settings.json that already configures LaTeX Workshop to:

  • Use XeLaTeX as the compiler
  • Set main.tex as the root document
  • Auto-clean auxiliary files after building

Step 5: Compile Your First PDF

Open main.tex. Click the green ▶ Build LaTeX project button in the top right, or press Ctrl+Alt+B.

LaTeX Workshop will run the full compilation sequence:

xelatex -shell-escape -8bit main
biber main
makeglossaries main
xelatex -shell-escape -8bit main
xelatex -shell-escape -8bit main
Enter fullscreen mode Exit fullscreen mode

The first compile may take a minute as MiKTeX downloads any missing packages. When it succeeds, main.pdf appears in the project root and opens automatically in the VS Code PDF preview panel.

GIF: Clicking the Build button in VS Code → compilation progress in the terminal → PDF preview appearing on the right

Step 6: Start Writing

Open any file in the chapters/ folder and start editing. Every time you save (Ctrl+S), LaTeX Workshop auto-recompiles and the PDF updates in real time.

Project structure:

my-thesis/
├── main.tex          ← Master file
├── chapters/         ← One .tex file per chapter
├── biblio.bib        ← Bibliography
├── illustration/     ← Images and figures
├── code/             ← Code files for minted snippets
└── style/            ← Formatting rules
Enter fullscreen mode Exit fullscreen mode

Tips From Actually Using This

Manage references with Zotero. Collect and organize references in Zotero, export directly as a .bib file into biblio.bib. Works seamlessly with Biber and saves a lot of manual formatting.

Keep your Git commits small. Commit chapter by chapter, not just at the end. You will want to roll back if you rewrite a section and change your mind.

Don't edit your style files. These contain the formatting rules. If you change them and something breaks, debugging is painful.

The Result

After compilation succeeds you have a properly formatted PDF — table of contents, numbered figures, bibliography, and acronym list all generated automatically. No style settings touched manually. No Word. No cloud.

Screenshot: VS Code with generated PDF

Why This Matters Beyond the Thesis

For students in technical fields, getting used to LaTeX means getting comfortable with plain text and structured writing. That mindset helps beyond just thesis work.

The setup took me around 30–45 minutes. After that, it was just writing.

Resources

If you run into any issues setting this up, feel free to leave a comment — happy to help based on my experience.

Top comments (2)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.