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.

Is there a way to display something like table of content of my current latex file in separate buffer, where all sections, subsections, figures and tables are listed interactively? So I could instantly jump to the piece just by clicking on it's link.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Yes there is such a way, and it is called reftex!

It should be included with your auctex installation. To start it, simply add the following in your .emacs and restart emacs :

(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)

reftex has many features, including easily insertion of labels, citations and references, AND an interactive table of contents. To access it, type C^c =. In the table of contents, use Enter to go to the selected section and close the ToC, Tab to go there without closing the ToC.

There are several other keys available, to show for example labels and crossref, you can find a small list at the bottom of the ToC buffer, or a complete list by typing ?.

share|improve this answer
    
Thank you, that is very nice and it will be very handy. Is it possible to include in ToC tables and figures even if they are not labeled? –  user21710 Nov 17 '12 at 11:23
    
I doubt it would be easy, since reftex relies on the \label commands to find it. Anyway, what's the point of having unlabelled figures or tables? –  T. Verron Nov 17 '12 at 12:04
    
I am working with other people latex documents and sometimes they leave floating objects unlabeled and refer to them with text. So if You say it is possible I will find a way. Again, thank you. –  user21710 Nov 17 '12 at 22:41
    
@user21710 : That problem isn't really relevant to the present question, but if you want a starting point, I'd say the "easiest" way would be to write a short elisp macro searching e.g. for \end{figure}, checking if the environment contains a \label, and add one if needed. Or to do this by hand if there aren't many figures involved. And don't forget to explain your coworkers why labelling figures is easy (even if I doubt they're using emacs) and good-practice. –  T. Verron Nov 17 '12 at 22:55
add comment

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.