Reformat latex document or paragraphs