auctex
[Top][All Lists]
Advanced

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

Re: Weird behavior of LaTeX-section-label for chapter


From: Shiyao MA
Subject: Re: Weird behavior of LaTeX-section-label for chapter
Date: Sun, 1 Mar 2020 10:13:15 +0800

Hi Arash,


Thanks for your help.

On Sun, Mar 1, 2020 at 4:37 AM Arash Esbati <address@hidden> wrote:
Hi Shiyao,

Shiyao MA <address@hidden> writes:

> The default value of *LaTeX-section-label is:*
>
> (("part" . "part:")
>  ("chapter" . "chap:")
>  ("section" . "sec:")
>  ("subsection" . "sec:")
>  ("subsubsection" . "sec:"))
>
> However, *for chapter*, when typing C-c C-s, we get cha instead of chap:.
>
> \chapter{asdf}
> \label{cha:asdf}

I presume you're also using RefTeX which is plugged into AUCTeX.  In
this case, AUCTeX transfers the job of inserting labels to RefTeX which
in return uses the values in `reftex-section-prefixes':

,----[ C-h v reftex-section-prefixes RET ]
| reftex-section-prefixes is a variable defined in ‘reftex-vars.el’.
| Its value is ((0 . "part:") (1 . "cha:") (t . "sec:"))
|
|   You can customize this variable.
|
| Documentation:
| Prefixes for section labels.
| When the label prefix given in an entry in ‘reftex-label-alist’ contains ‘%S’,
| this list is used to determine the correct prefix string depending on the
| current section level.
| The list is an alist, with each entry of the form (KEY . PREFIX)
| Possible keys are sectioning macro names like ‘chapter’, section levels
| (as given in ‘reftex-section-levels’), and t for the default.
`----

Customize this variable acc. to your needs and you should be set.

Best, Arash


--
Best,
Shiyao

reply via email to

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