Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Prompted by part of, but not belong in, the thread starting with "Markup
inside TD" :

Once upon a time, effectively before Windows and GUIs were known, I used
a word processor with cross-referencing; that would be a nice feature to
have in HTML.  I cannot recall its grammar; but it could gave been that
$ra<number>; would cause the printing of the next Number in sequence
'a', and, anywhere in the document, each $ca<number>; would cause the
printing of the Number printed by $ra<number> for the same <number>.
There, Number != number; and perhaps <number> was <identifier>.

One use would be to write an Ordered List with $r and to refer to its
elements with $c, so enabling the insertion of a new numbered item
without breaking existing number-links.

Another would be to generate links into a numbered list of references;
another to number equations, figures, etc.

ISTR writing a TECO macro to renumber the $r <number>s in numerical
order, altering the $c numbers accordingly; it was useful for the author
to see the <number>s in the source matching the Numbers in a printout.

The WP also had a convenient character %e.  In printing, it was treated
throughout as being a normal space, until the last moment when every $e
in a line would expand by (nominally) the same amount to make the line
reach the right-hand containing margin - essentially justification of a
single line, but treating its genuine spaces the same as letters.  E.g.

        $e words - right-justified words
        $e words $e - centred words
        Number $e equation $e - numbered centred equation
        Title $e number $e - for top of page  Or reversed.

 (c) John Stockton, nr London UK.  ?  DOS 3.3 6.20 ; WinXP.
   Web  < - FAQqish topics, acronyms & links.
   PAS EXE TXT ZIP via  <
   My DOS  < - also batprogs.htm.

Re: Cross-referencing

24.10.2011 20:55, Dr J R Stockton wrote:

Quoted text here. Click to load it

Word processors still have cross-referencing features, though most users
are probably unaware of them (as well as most other features).
Modern word processors have graphic user interfaces for this.

It would not be difficult to add such a feature to a markup language
like HTML. You could, for example, introduce an empty element like <ref>
with the idref attribute, using an id attribute to set the target, e.g.

  <li id=foo>my special item
<p>Item no. <ref idref=foo> is...

It could be defined so that the browser is supposed to present the <ref>
element as a number that is also a link to the corresponding item.

The hard part would to make relevant people interested in this, making
WHATWG and W3C standardize it, browsers to implement it, and authors to
learn about it and find it useful. And you would still have a problem
with old browsers which would show just "Item no. is...", which is bad.
I'm afraid there's no good way to make such constructs degrade gracefully...

Things like this are usually dealt with preprocessing or in server-side
code. This means, in effect, that you are using another language,
typically with its tags interspersed with HTML tags, and some software
that processes it and yields an HTML document, before anything is sent
to the client. You might even use Microsoft Word, with its
cross-referencing features, and produce HTML from it (naturally with the
cross-references fixed to have specific numbers). The main problem would
be that after any change, you would have to go through the troublesome
process of converting the "HTML" vomited by Word into something that
works reasonably well. (It's possible, just awkward.)

And I suppose that most people who need such mode of operating can deal
with it. They might not be happy with it, but they're fairly "happy
with" it in the American sense, if you see what I mean.

It wouldn't be difficult to implement the <ref> element with client-side
JavaScript, i.e. to write a script that replaces such elements by the
specific numbers. But I don't think this is really a job for JavaScript,
and the approach would not degrade gracefully at all when JavaScript is

Yucca, /

Site Timeline