Emacs: navigation multilayer latex documents with tags

I find Emacs tags a very useful feature for navigating the source code, which may be in different files. Since some of my documents in LaTeX are very long and with many \include, I thought it would be nice to use the Emacs tag function with LaTeX (sometimes I spend too much time searching for a specific subsection, for example). Reftex has a nice feature provided by the team reftex-tocfor working with multi-level documents, but I get the impression that instead it is better to find an unknown section using find-tag (unless someone convinces me of something else).

However, at least in my experience, the command ctags -edoes not parse some of my .tex files correctly (for example, some existing sections are not available), and it gets worse when I try to use with multi-layer latex documents (i.e. with many \include). Therefore, I have the following questions: do you use the tag function to navigate LaTeX multi-level documents? You have similar problems, and if so, are you using any hacks? And the last question: what about bibtex files? Do you know how to use the tag function with bibtex files?

And if you think Emacs provides the best ways to navigate LaTeX muiltifile documents, please also share :-)

Hooray!

+3
source share
2 answers

I use reftex-toc. This is great, especially for long documents such as a report or thesis. But if I write a short paper (or oddly formatted paper), reftex-toccan not cut it, or it may be too slow ( C-c =a little uncomfortable to type on my keyboard), and in those rare situations, I use a hack called ido-goto-symbol, I found where something on emacswiki . Not suitable for multi-type documents, t. K.

All in all, I think that reftex-tocis the way for large documents. If you are looking for headings that are hard to find otherwise, you may need to restructure the document.

+1
source

You can get a general menu of all your sections by typing:

M-x imenu-add-menubar-index

, - AucTeX, 5 :

TEX

AUCTEX , , .. .

M-x outline-minor-mode RET
. , outline-minor-mode-prefix, "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 .

0

Source: https://habr.com/ru/post/1781355/


All Articles