MikTeX on Arch Linux

2024/08/18

UPDATE May 2025 - in the last months, it seems that Arch got tlmgr compatibility. At the same time, Miktex has been slow to release versions that link against the latest versions of boost, meaning that you have to build it yourself or keep making symlinks to duct tape it together. I would not recommend the use of miktex on Arch. I now use tlmgr myself, and recommend that you install the collection-fontsrecommended tlmgr package to save yourself a bit of headache.


I recently got a new laptop and had to reinstall latex. The default way to do this is to install TeXLive with pacman, which is packaged into a set of groups which contain anything from the most basic installation (texlive-basic) to a virtually exhaustive installation (some combination of texlive-latexextra, texlive-fontsextra and a few others). I initially opted to install texlive-latexrecommended, until I tried to compile a document and realized I was missing fullpage.sty. This was only available in texlive-latexextra, and I also needed a font that was only present in texlive-fontsextra. So to get about 200 kB of .sty files, I was supposed to install >2 GB of packages.

Fortunately, I learned about MikTeX and made the switch. MikTeX, as I understand it, wraps traditional LaTeX tools like pdflatex in a script that detects missing .sty files and installs them (automatically, if so configured). Their motto is “Just enough TeX.” The installation requires a few steps, so I’m documenting here:

  1. Install miktex from the AUR. It has openjdk as a dependency, which is a little annoying but you’ll probably need it eventually and somehow the entire JDK is smaller than texlive-latexextra.
  2. miktex-console will not be available in your PATH, but it is located in /opt/miktex/bin/miktex-console. Run it. It will walk you through completing your installation and warn you to add your binary directory (it uses $HOME/bin, which is a bit annoying) to your PATH in your .bash_profile (in my case, .zprofile). Also tab over to the ‘Updates’ section and click ‘Check for updates’. You can also select whether to allow, prompt, or disallow on-the-fly installations of missing packages in the ‘Settings’ page (I started out with prompt and quickly changed to allow). You are now ready to use miktex, assuming you don’t have any other installations of TeX that come before it in your PATH.
  3. If you try to install something like Texmaker, you’ll run into an annoying issue where it doesn’t know you have LaTeX already and tries to install texlive-basic as a dependency. Don’t be fooled into installing twice as much TeX as you need! To prevent this, we can install a dummy pkgbuild that claims to provide LaTeX. Here it is:
pkgname=texlive-dummy
pkgver=1.0
pkgrel=1
pkgdesc="Placeholder to stop TeX installs"
arch=(i686 x86_64)
license=('custom')
provides=('tetex' 'texlive-bin' 'texlive-core' 'texinfo' 'texlive-basic')
conflicts=('tetex' 'texlive-bin' 'texlive-core' 'texlive-basic')
build() {
/bin/true
}
package() {
/bin/true
}

A quick makepkg -si and your LaTeX dependencies are forever satisfied.

Note: it is possible to install something like “Just enough TeX” using tlmgr manually, which I would normally be perfectly happy to do. I’m using MikTeX because the version of tlmgr that ships with LaTeX is broken; the Arch wiki describes a manual process for fixing it which must be re-run every time you update texlive-basic. This seems a little absurd to me, even if it does eliminate the OpenJDK dependency.