Re: Sane Syntax



On Aug 14, 2:43 am, Torsten Bronger <bron...@xxxxxxxxxxxxxxxxxxxxx>
wrote:
Steve Hicks writes:
[intermediate XML markup]

So what should this XML be capable of?  Maybe it's desirable to be
able to "project" it back to the original markup language
losslessly (and thus lossily project back to a different one).

I don't think that this is feasible.  Please have a look at page 11
of <http://tbookdtd.sourceforge.net/ltxmleb.pdf>.  The text is in
German but this figure should be understandable.

I was thinking about something similar, but that's a much better
representation. When I say "project" I'm implying a lossy
translation. It's sort of like a game of telephone - if converting
between different formats, you have to expect to lose something,
unless they're equivalent. But we've already decided that not all
formats can be equivalent. I suppose it's sort of a moot point, since
any translation/conversion can be done independent of what the
"standard" is, so maybe it makes the most sense to just focus on what
the standard should express. Then, you can use a Python front-end, or
Bobcat, and I can use something LaTeX-y, and maybe Tomek can even use
MSWord, and we can all use the same engine to actually do the
typesetting.

I don't know much about DocBook, but tsy's "Super DocBook" format does
look like a good starting point. And I think it will need to have the
capability for visual markup, if it's to be useful.

And since we're talking about markup to replace LaTeX, it seems to
me that this is all part of the same discussion.

I don't understand what you mean here. TeX and LaTeX are very
different things, I think.

"Pure" LaTeX, yes. But in practice, I don't know anybody that writes
pure LaTeX. But I'll return to my question about programmability,
because now that I'm not so tired I've got a much better example. It
sometimes happens that what we want to typeset depends on *how* the
material before it was typeset. Consider the optional argument to
\marginpar that allows a different box to be used, depending on
whether we're on an even or odd page. Or I've dealt with cases where
a particular box was too big to fit in the main column, and so
depending on even/odd-ness, I have it extrude into either the left/
right margin. One could imagine wanting to typeset references as
"equation (16) on page 23" if we're not on page 23, but simply
"equation (16)" if we are. Just looking at the variety of packages on
CTAN will show that there are all sorts of things people want to do.

Now, since this intermediate format must necessarily sit at a stage
BEFORE typesetting (it occurs to me just now that TGI for "Target-
independent", in analogy with DVI, might be a good name for it), it
needs to be able to express these choices. I can see two ways of
doing this:
1. use a sufficiently versatile TGI format - I can't see this as
being feasible because then I think we're right back where we started
by making a Turing-complete format.
2. allow extensions to the format. There should maybe be a way to
specify a sort of "failover" if the extension is unavailable for a
specific target... this makes me slightly afraid because it seems to
be a lot like postscript, in that you can tell a postscript file you
want this or that resource, but then (unless you include it yourself,
which is inefficient and often redundant) you depend on everyone who
wants to print the thing having the same resources available. But the
same is true if I include an esoteric package in a TeX document and
send it to somebody else, so maybe it's not such a terrible evil.

The 2nd option seems also to me kind of like the idea of stylesheets,
in that it does achieve the separation of content and presentation.
And if we can include this sort of "scripting" behavior inline (now
I'm thinking of HTML with embedded Javascript), then it seems like it
would actually encourage the use of a more sane sort of markup.
(OTOH, one look at the implementation of Gmail will send anybody
running for cover...)

Cheers,
steve
.