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

I was looking for this a while back for JavaScript, but I was wondering a general purpose one exists for all, or most languages.

For example for LaTeX I would put the following in a text box


and it spits out the better formatted version

%% Insert comment describing function here
$ f_{i}^{k} + 10 = x $

I can't be the only person on the planet that does not wish to go through a massive .tex file and fix these tedious problems.

share|improve this question

migrated from stackoverflow.com Oct 5 '11 at 19:09

This question came from our site for professional and enthusiast programmers.

@dmckee this is too funny, on the linke bdares provided, someone has further complained "This should probably be community wiki". I imagine if I checked the community wiki it will claim that it should probably belong on a blog... – puk Oct 5 '11 at 18:30
There is no guarantee that a question will find a good fit on the Stack Exchange network. In any case bdares link is not specifically about pretty printing now about literate programming/in-line documentation, so it may or may not be a duplicate. I'm not active enough on TeX.SE to be certain. – dmckee Oct 5 '11 at 18:34
@puk You misunderstand the comment. It merely means that the answers should belong to the community, instead of to individual users (it’s a Stack Overflow feature). The question bdares links to is fine, and so is yours. – Konrad Rudolph Oct 5 '11 at 18:34
@puk: Are you interested in "correcting" your LaTeX code (in the .tex file) so that super-/subscripts are actually put in braces { }, thereby possibly avoiding formatting problems? – Werner Oct 5 '11 at 19:17
@Werner I'm interested in an automatic code fixer upper which also aids in avoiding potential formatting problems. – puk Feb 2 '12 at 6:27
up vote 2 down vote accepted

I created a website that formats the latex code to make indents look correct.

The general idea of the website is to make sure you can read the code. It also provides table indentations. I am still looking to see if adding an empty comment block for formulas is possible.


share|improve this answer

Take a look at TeXpretty. I have used it a couple of times for cleaning up messy code and it does a decent job.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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