Step 1

LaTeX Installation

Install MiKTeX, enable on-demand package installation, and verify the base toolchain is ready.

Why MiKTeX

MiKTeX is the default distribution for this guide. It starts lightweight, works well for first-time users, and installs missing packages as you need them.

Download MiKTeX

Download it from the MiKTeX website.

Official MiKTeX downloads

MiKTeX homepage

On the download page, choose the installer that matches your operating system.

MiKTeX download page

Install MiKTeX

  1. Download the installer from the official MiKTeX download page for your platform.
  2. Finish the normal installer flow, then open MiKTeX Console once after installation.
  3. Run updates in MiKTeX Console before moving on, so the package database is current.
  4. Keep on-demand package installation enabled, since that is the working assumption of this guide.
  5. Confirm that latexmk is available. If it is missing, install it through MiKTeX Console before continuing.

The installer itself is straightforward. The first real checkpoint is that the setup wizard reaches its completion screen without errors.

MiKTeX setup wizard completion screen

After setup, search for latexmk in MiKTeX Console and confirm that the package is available for installation.

MiKTeX Console package search for latexmk

If latexmk is missing, let MiKTeX install it and wait for the package operation to finish.

MiKTeX package installation progress window

Platform notes

Windows

For this guide, treat Windows as the default path. Install MiKTeX first, then install Strawberry Perl as a required dependency so later latexmk/latexdiff workflows do not fail because Perl is missing.

perl --version
where perl
latexmk -v

macOS

Use the official MiKTeX installer for macOS. macOS environments usually expose Perl already (/usr/bin/perl), but you should verify from Terminal before moving on.

perl --version
which perl
latexmk -v

If perl is not found, install a Perl runtime first, then rerun the checks.

Linux

Linux is supported, but setup details vary by distribution. Follow MiKTeX’s official Linux installation page for your distro and package manager, then verify the toolchain with commands below.

Recommended post-install checks:

perl --version
which perl
latexmk -v
miktex --version

If latexmk is missing, install it from MiKTeX Console or your distro/MiKTeX package flow, then re-check.

Perl requirement

latexmk and latexdiff-style workflows both depend on Perl.

perl --version
latexmk -v

On Windows, install Strawberry Perl if Perl is missing. On macOS and Linux, verify that Perl is already available before you proceed.

Strawberry Perl download page

Package auto-installation

When a build pauses mid-compile, MiKTeX is likely fetching a missing package. On Windows, the dialog can appear behind the editor or as a small taskbar preview — look for it before assuming the build has hung.

If a build seems to pause, look for the MiKTeX package-install prompt. On Windows, it can appear behind the editor or as a small taskbar preview.

VS Code with a hidden MiKTeX package installation prompt preview

When the package dialog appears, allow MiKTeX to install the missing package so the build can continue.

MiKTeX package installation dialog for a missing package

Before proceeding

Confirm that MiKTeX Console opens and latexmk -v runs without errors. If your workflow uses Perl-based tools, verify perl --version as well.