Fixes for (PDF)LaTeX compilation

Two bugs where fixed in these commits:

    * Whitespaces and Brackets in filenames are now escaped correctly
    * Latex is compiled multiple times.