double $ management in latexgenerator