texmacs-dev
[Top][All Lists]
Advanced

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

Towards more structured markup (was [Texmacs-dev] References in section


From: Joris van der Hoeven
Subject: Towards more structured markup (was [Texmacs-dev] References in section titles)
Date: Wed, 18 Feb 2004 12:34:00 +0100 (CET)

On Wed, 18 Feb 2004, David Allouche wrote:
> On Tue, Feb 17, 2004 at 12:45:11PM +0100, Joris van der Hoeven wrote:
> > > Yes, this limitation sucks. This is an issue in the way automatic
> > > contents (like TOCs) are generated.
> >
> > This is not a "limitation", since a label inside a section title
> > obviously does not have the same semantics. What could be done though,
> > is modifying the editing routine for inserting labels in such a way that
> > we jump out of the title when starting a label inside a section title.
> > If someone wants to contribute a patch...
>
> In my opinion this is a limitation related to the fact that the
> generation of automatic content cannot filter out unwanted tags and that
> labels present in the section title will also appear in the table of
> contents.
>
> It makes a lot of sense to put labels associated to sections inside
> section titles, and that is what many users do intuitively.

What would be semantically correct is to associate a label to the whole
section title (like the "id" attribute in Html), but we did not yet
implement this.

> What I am wondering, is what is the correct way to implement the
> filtering?
> Is it generating automatic content from Scheme,

Imagine that someone writes a macro "mylabel" for special types of labels.
How would the code know to filter this macro out together with "label"?

> adding a filtering in the WRITE primitive,

How would you do that?

> or using a special environment variable to disable the typesetting of
> labels inside TOCs?

And what if I do want to put a label in a TOC? Also, people should remind
to set this environment variable for every new TOC-like feature.
This is quite complicated.

As a general rule, it is probably better to make the "DTD" more and more
precise and rather fix the place where to put labels than allowing
more places. This will make automatic treatment of documents easier.
The only thing we do have to do is develop tools for ensuring that
we respect our "DTD" and at least make it more difficult not to respect it.
That is why I suggested to jump out of the title when creating a label
inside a section title.

We also should implement labels attached to a portion of text (like the
html "id"). This solution is probably far most robust. More generally,
we should get rid of the badly structured things we still inherit
from LaTeX. Sections with a title and a body (and the same for
list items) is another example. In fact, I think that these are
the most important ones (can you think of any others?).

A way to implement labels attached to portions of text is to set
a special environement variable name "label-name" to the name of
the label and replace all assignments "thelabel := value" by
a macro which also attaches value to label-name. Later on,
we might consider replacing all current labels by structured labels.

As to sections with two arguments: at a first stage we might
create a package which reassigns the sectional macros to macros with
one or two arguments. If the macro takes one argument, then we fall back
to the old behaviour. Otherwise, the second argument stands for the body.
At a second stage, we then have to adapt the editor behaviour and
write a routine which upgrades documents to the two-argument format.
At the end, we may again consider the possibility of suppressing
sections with one argument alltogether.

Unfortunately, I have no time for all this now, but I hope that
the aim and the strategy are clear. So if someone does want to
do a lot of hacking...





reply via email to

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