added tex patch for pdf generation