Correct argument order for the report function of the tex report.

The filter and output file arguments were swapped.
If an output filename is given, use that for the TeX directory.

If only tex output is created (and not compiled) then by default a
temporary directory is used. However, the output option is now followed
to make it possible to choose another output directory.
This directory must not yet exist.