Update latexgen.cpp

added reset of var Dir_Old at the end.