Solving the “Could not find all biber source files” Error

Biblatex is a fantastic bibliography/citation manager for LaTeX. It trumps the older bibtex for its much easier customizability and configuration. It does however, have one bug that can be very perplexing to figure out due to the misleading error message that results: “Could not find all biber source files“. At first glance this message seemed straightforward enough to send me poking about the project file structure and build system, checking paths and names. When all that seemed intact, I started trying building the document from different locations. Then I checked out older version-controlled revisions of the project that I was sure I had built successfully, and when these, too, failed, I started to look at my TeX installation. And so on and so on, and before I knew it … poof! there went most of my morning.

This was all a wild goose chase, though, and luckily I came across this discussion before I got too far. (Well, at further too far, at any rate.) Turns out that this is a known bug with the Biblatex engine, “biber”. The fix is to clear the “biber” cache. You can locate the “biber” cache by running:

$ biber --cache

and then you can “rm -rf” it with extreme glee or just do it all in one step with:

$ rm -rf $(biber --cache)

Dynamic On-Demand LaTeX Compilation

Most of the existing approaches to integrating LaTeX compilation into a LaTeX writing workflow centered around a text editor (as opposed to a fancy-schmancy IDE) are horrendously bloated creatures, aggressively and voraciously hijacking so many key-mappings and normal functionality that it makes your Vim feel like it is diseased and is experiencing a pathological personality disorder of some kind. Yes, LaTeX-Suite, I am looking at mainly at you.

I did not want a platoon of obnoxiously cheery elves to insert two hundred environments into the document while a marching band parades around the room when I hit the `$` key. I just wanted a way to quickly and easily compile the current document, and optionally open it for viewing. Thus, I wrote a little plugin to do exactly that.

It has worked fine enough all this time. But today, thanks to a comment in a reddit discussion, I discovered something magical: latexmk

Not all that great if you use TexShop or another LaTeX IDE for latexing, but if you use a Plain Old Text Editor, then the following may change your life:

    $ latexmk -pdf -pvc nature-publication-2014.tex

Two neat things going on here.

First, “latexmk”. This is the smart-single-click-do-all latex compiler (and is almost always available with all TeX distributions). Takes care of all those multiple compilation passes with BibTeX and such. So, no matter how complex your document, a single command Gets It Done, from compilation to viewing:

    $ latexmk -pdf nature-publication-2014.tex

Then there are the ‘-pvc‘ flags shown above. This is where things get sexy. This invokes “`latexmk`” on the document which then compiles it as per usual. But then, instead of exiting, it waits there monitoring the file for any changes. Upon detecting changes (like `make`), it recompiles and refreshes the document in the viewer!

So, if you have a shell with this command running in the background (either in a separate window or through, e.g., tmux or screen), you can merrily edit away in your POTE, and have constant refreshes as you save.