Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Tool for cleaning LaTeX code

Beamer presentation files are very structures, they have sections, in which you find subsections, which include frames that have titles and then itemizations lists consisting of many items.

It would be nice to have a program that auto-indents the input file based on this structure.

I have output of the following sort in mind:

 \begin{frame}{title}
              {subtitle}
   \begin{itemize}
      \item My first item
      \item My second item
      \item My third and very very long third item which occupies more than 
         my pre-specified line length which is (say) 80 characters. 
      \item My fourth item comprising a description
         \begin{description}
           \item[First Item]
              Described here.
         \end{description}
   \end{itemize}
 \end{frame}
share|improve this question
    
Note that this problem is much easier than the problem of general formatting of LaTeX code, since beamer input is so much more structured, and just dealing properly with a handful of commands, should be a great service. –  Yossi Gil Apr 24 '12 at 16:45
add comment

marked as duplicate by diabonas, egreg, Thorsten, lockstep, Stefan Kottwitz Apr 9 '12 at 10:54

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 Answer

up vote 2 down vote accepted

You don't need a special program for that. Just use an good editor. Vim, Emacs are able to auto-indent. Others maybe too.

If you have not so well formatted code, you have to reformat the code.

I can only speak for Vim. Here you just have to mark the code you want to reformat and then press

z= 

Give it a try.

share|improve this answer
    
my vim spell checks with z= –  Yossi Gil Mar 20 '12 at 15:07
    
In emacs, you want to run M-x indent-region on the marked area. I think this is usually bound to Esc C-\ . –  cm2 Mar 20 '12 at 16:53
add comment

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