This question already has an answer here:

Is there any shortcut (or something else) that beautify the code, like ctrl+shift+f does in Eclipse or ctrl+k+d in Visual Studio?

marked as duplicate by Henri Menke, Stefan Pinnow, Sebastiano, Martin Scharrer Jan 17 at 9:31

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.

  • 1
    Well, shortcuts are features of specific tools. As LaTeX is a compiler not an editor, it does not has such a feature itself. It depends on your used editor (e.g. TeXWorks, etc.) or you can use an external tools. However, as (La)TeX is a "programming" language which allows to dynamically change syntax elements it is difficult to program such a tool. Some constructs, like verbatim text make it basically impossible. – Martin Scharrer Jan 17 at 8:24
  • 2
    I think the following answers your question tex.stackexchange.com/q/26102/2975, making it a duplicate. In short: I recommend latexindent, which can be integrated as external tool by advanced editors/develop environments like Eclipse. – Martin Scharrer Jan 17 at 8:25
  • 1
    Why don't you just use eclipse for writing and compiling? Seems like the mist natural choice for you. – Johannes_B Jan 17 at 8:33
  • @Johannes_B: I think the mentioned Eclipse shortcut only works for C, C++, Java etc. I don't think Eclipse has a LaTeX formatter. – Martin Scharrer Jan 17 at 9:32

Browse other questions tagged or ask your own question.