latex: Support LuaTeX.

Copied from http://tex.stackexchange.com/a/47711