This question already has an answer here:

Is it possible to indent in texstudio based on the levels? It seems that a proper macro might be able to do such a job, though it seems to be complicated.


Thanks to Troy, we know that latexindent has this capacity.Therefore the problem is to write a macro which runs the latexindent on all file at once without causing problems.

marked as duplicate by Troy, TeXnician, Stefan Pinnow, user36296, egreg Dec 10 '17 at 23: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.

Browse other questions tagged or ask your own question.