mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Lists with prefixes on labels


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Lists with prefixes on labels
  • Date: Wed, 2 Apr 2008 16:08:30 +0200

On Wed, Apr 02, 2008 at 01:45:58PM +0100, Jeremy Henty wrote:
> On Wed, Apr 02, 2008 at 12:40:12PM +0100, Jeremy Henty wrote:
> > I would like to have lists that are distinguished by prefixes on
> > their labels, ie.
> >
> > Here's a list of axioms:
> > Ax-1 ...
> > Ax-2 ...
> > and here are some of their consequences
> > Thm-1 ...
> > Thm-2 ...
> > Thm-3 ...

There are several answers possible to your first question.
The different possibilities:
1) Define a new list environment with a parameter giving the prefix.
2) Define a new list environment for each prefix using the new-list macro.
3) Use the enumerate* environment which defines a sublist,
and manually adjust the corresponding prefix.

> Following up to myself: I'm getting somewhere with creating a new list
> environment with the new-list macro, but <Enter> does not start a new
> item inside my new list. How can I fix that?

In the case of solution 1, you may manually overload the function
kbd-return for the case when we are inside your environment:

(tm-define (kbd-return)
(:inside enumerate-prefixed)
... code to insert a new item ...)

Please look at what is done for standard lists in std-text-edit.scm.

In the case of solution 2, you may wish to extend the group of
itemize or enumerate environments for each new environment with
a given prefix. This is done using

(define-group enumerate-tag enumerate-mine),

as you can see in std-text-drd.scm.

In the case of solution 3, the enumerate* environment already behaves
like a standard enumeration. The only inconvenience is that you need
two primitives instead of one for every list (one for modifying
the prefix + one for enumerate*).

Best wishes, Joris



Archive powered by MHonArc 2.6.19.

Top of page