adding latex class and rely to latex-templates to avoid double
declaration of classes
improve regex for find and remove