auctex
[Top][All Lists]
Advanced

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

which-func, imenu, AUCTeX


From: Greg Bognar
Subject: which-func, imenu, AUCTeX
Date: Wed, 16 Oct 2024 02:15:27 +0200

Hi, this is (mainly) a cosmetic question.

I like to display the section (chapter, etc.) name on the modeline by using
which-func.  If I understand correctly, which-func uses imenu to get the
function (section, etc.) names, and AUCTeX supports imenu by setting
`imenu-create-index-function' to `LaTeX-imenu-create-index-function'.

However, the menu entry that is returned on the modeline looks like:

section{My Section}

or

chapter{My Chapter}

rather than

My Section

or

My Chapter

as I would expect (and as which-func does in other modes).  Worse, if in the
preamble I have something like

\titlespacing\section{0pt}{2\bigskipamount}{\parskip}

then I get "section{0pt}".

Is there a way to modify `LaTeX-imenu-create-index-function' (if that's indeed
the culprit) so that it only returns the section (chapter, etc.) name without
the \-less section (chapter, etc.) command?  And that it does not pick up things
like \titlespacing\section{0pt}?

(Interestingly, the items that appear in the imenu menu on the menubar are
slightly different than the items that are displayed on the modeline.)

Thanks!

All the best,
Greg



reply via email to

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