build tex and pdf versions