Added tex-mode hack to compile with --shell-escape.