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.

I'm new to AUCTeX and I wonder:

is it possible to fold entire sections or subsections of a LaTeX document for a better overview, so that they are only represented by their headline (kind of a tree view of the document)?

I would expected that being done by the "folding" features, but I could not manage to hide a whole section, but folding seems to hide only some selected elements of the source code.

Is there a feature like what I'm searching in AUCTeX?

share|improve this question
    
Could you post a MWE including the part of the source code that fails to fold completely? –  Ricardo Dec 30 '12 at 16:40
3  
With TeX-fold-mode and outline-minor-mode you should be able to fold the document in a manageable way (via the outline menu and corresponding bound keys). However, without a minimal example, we can only take guesses at what might be wrong. –  Ricardo Dec 30 '12 at 16:46
    
@Ricardo: thanks! in the meantime I found out, that "folding" is not what I need, but this outline-minor-mode... the problem is: I can not enter the commands, because Aquamacs does not recognize the "@" sign: superuser.com/questions/525988/… –  Martin Dec 30 '12 at 17:05
    
TeX-fold-mode is here to fold environments and macros (for example replacing \lambda with a unicode lambda or hide a long proof). outline-minor-mode is what you need, as you stated, but you shouldn't have to set the heading levels yourself, auctex should take care of that for you. –  T. Verron Dec 30 '12 at 17:08
    
@T.Verron: thanks. So which commands could I use to jump e. g. to the next section heading on the same level as the current one? As stated in the linked question in the superuser-forum, I can not enter any commands containing "@" at the moment. –  Martin Dec 30 '12 at 17:10

2 Answers 2

up vote 8 down vote accepted

TeX-fold-mode is here to fold environments and macros (for example replacing \lambda with a Unicode lambda or hiding a long proof). outline-minor-mode is what you need, as you stated in the comments, but you shouldn't have to set the heading levels yourself, AUCTeX should take care of that for you.

If the key mapping is a problem to you, the easiest way to change it is to change the prefix-key for outline-mode.

This solution is described on EmacsWiki, where I found the following code snippet (to be added in your .emacs:

(add-hook 'outline-minor-mode-hook
            (lambda () (local-set-key "\C-c\C-@"
                                      outline-mode-prefix-map)))))

The above snippet will actually do nothing in AUCTeX, but you can replace \C-c\C-@ with any sequence of keys you like. The shortcuts will then use that key sequence instead : for example, to move to the next visible heading, you'll use <your key sequence> C-n.

You'll find on EmacsWiki many other options to change the keybindings, as well as suggestions for the choice of keys (but you'll probably need to figure out what key to use yourself, due to the many keybindings needed by AUCTeX).

share|improve this answer

Scrolling is not my hobby...

For easy navigation use the table of contents inside Emacs. Just type C-c = and Emacs displays it. You can navigate incredibly fast.


From the comments, if it does not 'work out of the box,' you can use

M-x reftex-mode

to turn it on for the current buffer or, to make the change permanent, add the following to your .emacs:

; If you use AUCTeX (you probably do; if you don't, you probably should):
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)

; If you do not:
(add-hook 'latex-mode-hook 'turn-on-reftex)
share|improve this answer
2  
You might want to mention that this requires RefTeX and how to enable it. –  N.N. Dec 30 '12 at 19:09
    
thanks a lot, Keksdose!! This is really cool - thanks! Not an answer to the question, but a really great "workaround" :-) @N.N. in my case (Aquamacs 2.4 on OS 10.6.8) it worked out of the box. :-) –  Martin Dec 30 '12 at 19:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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