Lesssons Learnt from Fixing broken Xetex on Arch Linux

I build and maintain a bunch of documents in Latex, though I'm not an expert in Latex, I still found it easier to maintain than keeping a Word document around -- whenever I want to modify things, I would open Tex Studio, modify and then rebuild. The generated PDF is symlink to my desktop for easy access when I need to attach it. This works well till last Friday. I modify things, and the generated PDF did not reflect any of the changes I made. What could be the problem?

Locate the problem

Well, it wasn't really easy to diagnose the issue from the Tex Studio interface -- every time I rebuilt, it looks as if it was generating new docs but it wasn't actually doing that (cause the speed was simply too fast). So, the solution was to use CLI -- I got the actual command from settings in Tex Studio.

I first ran: xelatex -synctex=1 -interaction=nonstopmode -output-directory=build "document".tex

What I got was:

/var/lib/texmf/web2c/xetex/xelatex.fmt made by different executable version, strings are different

Well, to be honest, this error message wasn't helpful at all. It still wasn't clear what the issue was. But it's still worth looking it up.

Attempted Solutions

❌ fmtutil

This was among many of the top links I found by Googling ^1. So it was the first solution I tried -- running

1
fmtutil-sys --all

It didn't fix the issue, still failing.

❌ reinstall packages

Normally this would have solved the issue, so I next attempted to reinstall the packages related to Latex. I ran:

1
sudo pacman -S texlive-formatsextra texlive-latexextra

Didn't solve the issue either.

Read the Wiki carefully

Well, this should have been the first thing I tried, but I didn't. The ArchLinux Wiki here outlined the packages that's packaged by Arch and available to use.

So I installed the xetex package sudo pacman -S texlive-xetex, and then everything got back to normal.

Lessons learnt

While I still don't understand what was the exact cause of this issue, it is most likely caused by this changes made a year ago. But I don't really believe that cause I remember using the Tex Studio fine in March. But anyway, here's what I learnt:

  • Read the Wiki: ArchLinux Wiki is really really useful. Even if you are not an Arch user, chances are, you can get something out of it. So this should be the first place to look at when you are facing issue.
  • pacman could locate package: While it is not useful in this case, it's good to know pacman can locate the package that a file belongs to. Either of the command would work:
    1
    2
    3
    4
    5
    # If you are searching for a package that has this file
    pacman -F soul.sty

    # If you are searching for the package that owns this file
    sudo pacman -Qo PATH/TO/FILE