3

I find Emacs tags a very useful feature to navigate through source code that can be in different files. Since some of my documents in LaTeX are very long and with many \include's, I thought it would be a nice thing to use the Emacs tags feature with LaTeX (sometimes I spend too much time trying to find a certain subsection, for instance). Reftex has a nice feature provided by the command reftex-toc with works with multifile documents, but I have the impression that it's easier to locate some unknown section with find-tag instead (unless if someone can convince me otherwise).

However, at least in my experience, the command ctags -e does not parse some of my .tex files correctly (e.g., some existing sections are not available), and things get worse with I try to use with multifile latex documents (i.e., with many \include's). So I have the following questions: do you use the tags feature to navigate multifile LaTeX documents? Do you have similar problems and, if you do, do you use any hack? And the last question: what about bibtex files? Do you know of a way of using the tags feature with bibtex files?

And if you think that Emacs provides better ways to navigate through LaTeX muiltifile docs, please also share :-)

Cheers!

2 Answers 2

1

I use reftex-toc. It's great, especially for long documents such as a report or a thesis. But if I'm writing a shorter paper (or a strangely formatted paper), reftex-toc might not cut it, or it might be too slow (C-c = is a bit awkward to type on my keyboard), and in those rare situations, I use a hack called ido-goto-symbol, which I found somewhere on emacswiki. Not good for multifile documents, tho.

In summary, I think reftex-toc is the way to go for large documents. If you are looking for headers that are hard to navigate to otherwise, it might be worth to restructure the document.

2
  • Thanks! I'm already having lots of fun playing with ido-goto-symbol. Just out of curiosity, have you tried the idomenu.el as well? (its link is just before the code for ido-goto-symbol you've posted)
    – falsum
    Commented Dec 22, 2010 at 12:45
  • No, I haven't tried idomenu.el, I find ido-goto-symbol more than enough for my needs. It's useful for most things I do, including bibtex-editing (ok, ebib is better for adding/handling, but for quick edits ido-goto-symbol is really handy).
    – monotux
    Commented Dec 22, 2010 at 17:25
0

You can get an outline menu of all your sections by typing:

M-x imenu-add-menubar-index

Also, from the AucTeX cheat sheet, where the last 5 commands listed pertain to navigation:

Outlining TEX Documents

AUCTEX supports outline mode by defining section, subsection, etc. as heading levels. You can use

M-x outline-minor-mode RET
to toggle outline minor mode. All outline minor mode commands are under the prefix key specified by outline-minor- mode-prefix, default is “C-c @”.

Hide all of buffer except headings       C-c @ C-t
Show all text in buffer                  C-c @ C-a
Hide body following this heading         C-c @ C-c
Show body following this heading         C-c @ C-e
Hide subtree                             C-c @ C-d
Show subtree                             C-c @ C-s
All subheadings visible                  C-c @ C-k
next visible heading                     C-c @ C-n
previous visible heading                 C-c @ C-p
forward to next subheading               C-c @ C-f
backward to next subheading              C-c @ C-b
up one heading level                     C-c @ C-u

AucTeX supports multiple files, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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