texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] Cleverref


From: David Allouche
Subject: Re: [Texmacs-dev] Cleverref
Date: Sun, 22 Feb 2009 00:56:14 +0100

On Sat, Feb 21, 2009 at 15:23, Bas Spitters <address@hidden> wrote:
> Could you give me some more pointers? Where is the anchor macro defined?
> If I understand you correctly, texmacs is aware of the environment it is in
> (lemma, proposition, section, etc)

I cannot test things because texmacs does not start up on my system,
but here's how I would go at investigating.

1. Create a link anchor in a file, save the file, look in the content
of the file for the anchor to figure out the exact name of the texmacs
structure involved. I believe it's "label" or something like that. Do
the same with a link reference.

2. Armed with that, grep in the texmacs packages files for the
definitions of the label and cross-reference macros. Its probably in
the packages/standard directory. That will tell you how to store and
retrieve label text.

3. Look in packages/environment/env-theorem for the definition of
theorems, lemmas, etc. That should tell you if there is a variable
storing the type of the current theorem-like environment, and the name
of this variable.

With that in hand, you probably have two options:

A. Make just a custom label macro, whose reference text will always
include the type of the including theorem-like environment if there is
one.

An alternative to that is to extend the label macro. It used to
involve storing the base macro definition in an intermediate macro,
then define the new macro in terms of the intermediate one.

B. Make a pair of custom label and xref macro. That would be useful if
it's possible to use a distinct label namespace for your macros. I do
not remember if it's the case.

> How do I test for this?

The testing process when hacking texmacs stylesheets involves just
creating a document with some test data (a theorem, a label, a
reference), inserting some macro definitions at the beginning of the
document and hacking until it works. Save frequently. One nice trick
allowed by texmacs is that you can have one view of the same buffer in
normal mode, and one view of the same buffer in a different window in
preamble mode (where you can see activated macro definitions).

Since you work with labels, you will probably have to frequently
rebuild the references of your document.

Hope this helps.




reply via email to

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