Add preprocessing for latex code and more importantly handle serial/parallel extraction with time wrappers to prevent endless freezing,