auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting frame title in imenu


From: Mandar Mitra
Subject: Getting frame title in imenu
Date: Thu, 20 Aug 2020 17:53:21 +0530

When preparing a presentation using Beamer, I'd like the frame 
titles to be listed in imenu, along with section names. I use 
the \begin{frame}[optionals]{Frame title here} form, rather than 
a separate \frametitle (and would rather not change that habit 
if I can help it).

So I customised TeX-outline-extra to

'(("^\\\\begin{frame}\\(\\[[a-z,]+\\]\\)?" 3))

As far as I can tell, LaTeX-outline-name (called from
LaTeX-imenu-create-index-function to "Guess a name for the
current header line.") starts from the beginning of the
match and skips forward to the first "{". It thus ends up
picking "frame" as the header line which is not useful.

I suppose I could use imenu-generic-expression with
imenu-default-create-index-function -- that allows me to
explicitly say which part of the match I want to pick out
as the header -- but then I'd have to convert
latex-outline-regexp to the structure used by
imenu-generic-expression.

Is there any other easy workaround that I'm missing? 

Grateful for any help, thanks!
-mandar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]