He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him.
Latex produces beautiful output. But the input files is often terrible. Trying to make your code readable is often a tedious task. Especially if you are dealing with a large document.
Therefore , I have, for a long time, searched for a tool to auto format latex code, just like you can do with almost all modern HTML editors. As latex is also a markup language, I really could not believe that nobody had ever developed such a tool. When I therefore recently found a tool that does just t that I was joyous. latexindent is a perl script that formats your code.
How To Use
If you have latexindent installed, you can run the script from any terminal.1 Else you will have to put it in your root folder. You can use the script simply by running
you can put a local settings file in your root directory as well. There is even an implementation with arara
A tikz figure like this
I hope you get the idea.
latexindent comes installed with texlive and mactex ↩