Correctly trap latex build error.
Tweak latexmk parameters to force completion of build.
Fix error reporting.