Bug 183049 - Recognize more flexible label commands
Summary: Recognize more flexible label commands
Status: REPORTED
Alias: None
Product: kile
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 20:36 UTC by Ryan Reich
Modified: 2023-01-08 20:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Reich 2009-02-03 20:36:38 UTC
Version:            (using KDE 3.5.10)
Compiler:          gcc-4.2.4 
OS:                Linux
Installed from:    Gentoo Packages

For my own convenience, I have modified the "theorem" environment so that it works like this:

\newtheorem{lemma}{Lemma}
\begin{theorem}{lemma}{label name for this lemma}
...
\end{theorem}

There is no way I can see to indicate to Kile that the label for this theorem is contained in the second argument to the theorem environment.  I would like to see the list of labeling commands support the possibility that the command is an environment and that it has the label name as one (any one) of several options.
Comment 1 Thomas Braun 2009-05-27 00:24:09 UTC
Have you tried configure kile->latex->general->commands configure?
Comment 2 Ryan Reich 2009-06-01 23:15:44 UTC
Yes, I have.  It doesn't work for the reasons I gave in my initial report: that facility does not allow me to specify _which_ argument of a macro contains the label.  I can clarify: configure->latex->general->commands(Configure) allows me to register both new environments and new commands with Kile.  However, the former doesn't recognize the possibility that the environment might define a label, and the latter doesn't recognize the possibility that a command might have more than one argument or be an environment with a command-like "side effect", for example, defining a label.  As far as I can tell, the only way I can register a labelling command with Kile is to define a single new macro, e.g.

\mylabel{<label>}

which takes one argument, and enter it into the Configure dialog.  This is, however, not what I have.

As a way of correcting this, may I suggest a structural change to the Configure dialog: rather than presenting the user with two categories ("Environments" and "Commands") each with a list of mutually-exclusive and limited options (such as "Citations" or "Labels"), simply unify the whole thing.  In this setup, I might create a new entry as follows:

Command: cite{<citation>}*{}

as for the extended \cite command provided by the amsrefs package.  This has a very odd syntax, in which the first argument is the name of a bibliographic entry and the *{} is an optional addition allowing the citation to be printed like [1, Theorem 2].  Unfortunately, there is no way to indicate that this part is optional, so this is really a declaration of the command when the * part is included (like for autocomplete, which has different cases for optional arguments).  Under this scheme, my modified theorem environment would be declared

Environment: theorem{<theorem counter>}{<label>}

(perhaps Kile could find a use for tracking theorem counters; if not, then nothing would go inside arg 1).  After seeing this declaration, Configure could then ask some more specific questions of the sort that already are asked: does it have an EOL command? is it math? etc.  This would greatly simplify the entire Configure dialog in addition to making it more powerful.