TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing question.

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
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

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

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