auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] LaTeX-equation-label with file-dependent prefix


From: Shan
Subject: Re: [AUCTeX] LaTeX-equation-label with file-dependent prefix
Date: Thu, 6 Jun 2013 11:32:36 -0500

It seems that the lisp function concat, file-name-nondirectory and file-name-sans-extension haven't been executed in my case.


On Thu, Jun 6, 2013 at 11:28 AM, Shan <address@hidden> wrote:
Hi Tassilo,

Thanks for your help. I'm sorry but I can't get this working in my file. When I use C-c C-e to insert a new equation, I was prompted to insert a label instead of getting a filename as prefix. Am I missing something? Thanks!


On Thu, Jun 6, 2013 at 1:48 AM, Tassilo Horn <address@hidden> wrote:
Shan <address@hidden> writes:

Hi Shan,

> Since I have several tex files included in a main tex file, I'm
> wondering whether it is possible that I can redefine the
> LaTeX-equation-label so that the equation label may take the filename
> (or some environment variable) as an additional prefix. Thank you very
> much!

This works for me:

%%% Local Variables:
%%% LaTeX-equation-label: (concat
%%%                        (file-name-nondirectory
%%%                         (file-name-sans-extension
%%%                          (buffer-file-name)))
%%%                        ":" LaTeX-equation-label))
%%% LaTeX-label-function: nil
%%% End:

The `LaTeX-label-function' is explicitly set to nil, because if you are
using reftex, it's set to `reftex-label' which doesn't use
`LaTeX-equation-label' to construct a label name.

Bye,
Tassilo


_______________________________________________
auctex mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/auctex



--

Best,
Shan



--

Best,
Shan

reply via email to

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