Refined folding definition for latex mode