updated pdflatex function and fixed a few tables and figures not being generated, because input files weren't written to touch file