[Top][All Lists]

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

Re: [AUCTeX-devel] Manage auto insertion of labels

From: Vladimir Lomov
Subject: Re: [AUCTeX-devel] Manage auto insertion of labels
Date: Wed, 13 Aug 2014 07:55:17 +0900
User-agent: Mutt/1.5.23 (2014-03-12)

** Mosè Giordano [2014-08-12 16:45:47 +0200]:

> 2014-08-12 14:49 GMT+02:00 Tassilo Horn <address@hidden>:
>> Mosè Giordano <address@hidden> writes:

>>> Ok, a possibility would be to change the value accepted by
>>> `LaTeX-insert-label' to, e.g,

>>>     (t . ("section" . section) ("subsection" . environment))

>>> so each element of the CDR is a cons, whose CAR is the name of the
>>> macro/environment, and the CDR is the type.

>> Quite complex.  Maybe it would be simpler to have special keys for the
>> alist, e.g.,

>>   ((environment-whitelist "figure" "table")
>>    (environment-blacklist ...)
>>    (section-whitelist ...)
>>    (section-blacklist ...))

>> And basically, having both a *-whitelist and a *-blacklist doesn't
>> really make much sense.  So it could be compressed to, e.g.,

>>   ((environments t "figure" "table")
>>    (sections nil "paragraph" "paragraph*" "subparagraph" "subparagraph*"))

>> meaning that only figure and table environments get a label (t =
>> whitelist), and only sections "larger" than paragraph get one (nil =
>> blacklist).

> My idea of using t for blacklist and nil for whitelist was due to the
> fact that for the base cases (always insert label, never insert
> labels) I used t and nil, and adding exceptions was as simple as
> adding elements to the list, keeping the same first element (t or
> nil), though I agree t is logically more adapt for a whitelist and nil
> for a blacklist.

> However, I'll try to implement this interface later today.

>>> The `LaTeX-label' function must be changed to take a second mandatory
>>> argument specifying the type of the macro/environment to be labeled.

>> I think `LaTeX-label' can figure that out on its own by calling
>> `LaTeX-current-environment'.  If that returns "document", we're probably
>> inserting a section label, else we're inserting an environment label.

> Well, in beamer you can add a sectioning command inside a frame
> environment.  This is not the standard behavior but it's legal to
> insert a sectioning command inside an environment different from
> document.  In addition `LaTeX-current-environment' isn't bullet-proof,
> so avoid using it would be nice ;-)

>From the first proposition by Mosè Giordano, I thought that I could
"advise" corresponding label function to which macro, environment or
place in document insert a label macro. Also, I imagined that there will
be some function that allows, depending on context to use a customized
prefix (for example, "fig" for figures, "tab" for tables, "eq" for
equations, "page" for page-labels) and may be some function to generate
unique labels (part after a prefix or may be complete label), not only
simple counting. But seems I was wrong. According to the following
discussion seems that the proposed 'LaTeX-label' will be too complex and

P.S. I got into this discussion only because Mosè Giordano mentioned
some subtle LaTeX features (the usage macros and environments with the
same name).

WBR, Vladimir Lomov

"Hi, I'm Professor Alan Ginsburg... But you can call me... Captain Toke."
-- John Lovitz, as ex-Supreme Court nominee Alan Ginsburg, on SNL

reply via email to

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