Alessandro Bertulli <> writes:

> Arash Esbati <> writes:
>> You're looking for `reftex-section-levels'[1].
> Many thanks!

You're welcome.

> However, I now wondered if I could make RefTeX aware of single songs
> too. I tried
> (add-to-list 'reftex-section-levels '("beginsong" . 5))
> but somehow it doesn't work: songs don't show up in the TOC, even if I
> issue a `5 t` in it. What am I doing wrong this time?

It depends a bit on how you did that addition.  If you've done that in a
buffer after loading RefTeX, you probably have to eval
(reftex-compile-variables) in that buffer as well.  Otherwise you have
to provide a recipe how others can reproduce it.

I also had a closer look at the docstring of `reftex-section-levels':

,----[ C-h v reftex-section-levels RET ]
| reftex-section-levels is a variable defined in ‘reftex-vars.el’.
| Its value is shown below.
| Commands and levels used for defining sections in the document.
| This is an alist with each element like (COMMAND-NAME . LEVEL).
| The car of each cons cell is the name of the section macro (without
| the backslash).  The cdr is a number indicating its level.  A negative
| level means the same level as the positive value, but the section will
| never get a number.  The cdr may also be a function which will be called
| to after the section-re matched to determine the level.
| This list is also used for promotion and demotion of sectioning commands.
| If you are using a document class which has several sets of sectioning
| commands, promotion only works correctly if this list is sorted first
| by set, then within each set by level.  The promotion commands always
| select the nearest entry with the correct new level.
|   You can customize this variable.
| Value:
| (("part" . 0)
|  ("chapter" . 1)
|  ("section" . 2)
|  ("subsection" . 3)
|  ("subsubsection" . 4)
|  ("paragraph" . 5)
|  ("subparagraph" . 6)
|  ("addchap" . -1)
|  ("addsec" . -2))

Since promotion and demotion both rely on this variable, I think it
shouldn't be changed by an AUCTeX style from lisp with `add-to-list'.

Best, Arash

Reply via email to