added latex mode