1

I know that there is RefTeX with its TOC, and I know how to include \frametitle there (see here). Nevertheless, I would like to see \frametitle also appear in imenu. What would be the minimal way to get to this?

2

Try this

(push '("frametitle" 2) TeX-outline-extra)

See the documentation for TeX-outline-extra. The first element of the list being added is a regexp and the second is the imenu level. You can also see LaTeX-section-list for the default levels that imenu uses for latex.

Update:

As suggested in the comments, it might be a little safer to use the following. This change makes no difference for my use though.

(push '("\\\\frametitle\\b" 2) TeX-outline-extra)
  • 1
    AUCTeX manual also says: A ‘^’ is automatically prepended to the regular expressions in the list, so they must match text at the beginning of the line. Hence, I suggest you do (add-to-list 'TeX-outline-extra '("\\\\frametitle\\b" 7)). – Arash Esbati Dec 20 '16 at 8:34
  • That may be what it says, but that's not the regexp that is actually used. See the LaTeX-outline-regexp function. In any case, your regexp will prevent matching against something like \AframetitleA{} so I updated it. Thanks – justbur Dec 20 '16 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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