Is there some kind of automatic test to check for best practice according to some sort of style guide in LaTeX, or will there be any in near future? For python we have pep8, pyflakes, pyflint, and whatnot, which helps a great deal.

I know there are a lot of paper, like the essential guide to LaTeX usage and the Short Math Guide, and talks out there, like the one by Didier Verna. Also several questions have been asked on stackoverflow, but no one asked for some kind of automation, which could help shape our LaTeX code, especially when I think of collaborative work on github or ShareLaTeX.


No there isn't and can't. Because of TeX's in-place replacement parsing, it is not possible to analyze the code without fully expanding everything and still then it wouldn't be possible to know what is what.

Note that PEP8 is also an agreement of (a small part of) the community not an essential property of Python. And the tools you mentioned follow the agreement not the language itself. In TeX there is no, fortunately, such agreement.

  • 5
    We do have a style guide for expl3 code (certainly not entire documents), though I think it's rather shorter than some of the examples in the question (and really mainly for the team's own code). It's also mainly 'encouragement' not 'requirement' ;-) – Joseph Wright Jan 19 '16 at 15:20
  • @JosephWright Ah I should have remembered that. – percusse Jan 19 '16 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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