new function to collect all warnings/errors in output buffer
adapt TeX-warning