Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Tool for cleaning LaTeX code

I got a simple question.

I just got hold of a, very "ugly" latex document. By ugly I mean, that the source code is almost unreadable.

Is there a application (or a plugin ...) to autoformat latex markup?

share|improve this question

marked as duplicate by Joseph Wright Nov 5 '11 at 7:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6  
Welcome to TeX.sx! This question is very similar to tex.stackexchange.com/questions/100/…. Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. –  doncherry Oct 14 '11 at 14:56
7  
Let me ask two questions: First, notwithstanding the input file's ugliness, can you compile it on your system, or does it require additional files that you don't have? Second, does the latex file by any chance come from a co-author who uses "Scientific Workplace"? If the answer to the second question is "yes," you should ask him/her to use the non-default way of saving a file. SWP's default save mechanism makes the raw tex file nearly unreadable. Fortunately, there's a second save option that makes the source file much more readable and also less dependent on SWP's special codes. –  Mico Oct 14 '11 at 19:22
add comment

1 Answer

Emacs in latex mode does a very good job. Just open the document in Emacs, select it and run C-M-\ (indent-region)

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.