views:

225

answers:

1

Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of that figure environment hidden from view. Similarly with \begin{proof} and so on, and ideally even with \subsections.

Is this possible? I just tried hs-minor-mode, allout-mode, and outline-minor-mode, but most of them don't recognize LaTeX's environments, e.g. hs-minor-mode fails with "scan error: unbalanced parentheses". I would prefer not to have to enter explicit folding marks like {{{ as in folding-mode.

[Ideally it would be great if the folding were persistent, but I see that that question doesn't have an accepted answer yet.]

+6  A: 

AUCTeX does folding: http://www.gnu.org/software/auctex/manual/auctex.html#Folding

AVB
Indeed, thanks! I feel like an idiot now. :-)
ShreevatsaR
You can also use outline commands, like M-x hide-body and M-x show-subtree. Also check out RefTeX, which has a ToC navigation feature.
Joel J. Adamson