Fix LaTeX generation