Fix error messages when checking modes by not indenting with .RECIPEPREFIX.
Fix generation of git version tag for the Latex document.

Use git rev-parse --is-inside-work-tree to find out if we reside in a
git repo or not.
Only run bibtex if we see any \cite{ | \nocite command in latex main file or inputs.