On 7/29/07, David Chisnall <[EMAIL PROTECTED]> wrote:
> Finally, LaTeX produces really gorgeous output.  Something like Word,
> which tries to make ligatures of really strange combinations of
> letters, just looks hideous in comparison.  The OS X text system is
> not far off, so GNUstep has the potential to give us similar quality
> if I poke my SoC student hard enough.

As an aside, the actual layout algorithm is detailed in the TeX book.
I *think* there's an examplar at the uni library, but maybe not. In
any cases, hopefully a search on acm/ieee or google scholar could come
up with layout algorithms; as far as I remember, the main difference
between TeX and the rest of what's out there is that TeX computes the
gray value of a paragraph, and layout the text to have as much as
possible a uniform gray value. (also, you can tweak that in many, many
ways in TeX, but..)

> _The Not-So-Good_
>
> LaTeX is built on TeX.  I don't actually use LaTeX, I use LaTeX plus
> a load of packages, plus a load of my own additions.  This presents
> real problems for a text editor.  Consider the following two snippets:
>
> \code{foo += bar}
>
> \codefile[caption={A short listing}]{examples/short.c}
>
> In these two snippets, the arguments to the first should be spell-
> checked according to the rules for C (i.e. spell check strings and
> comments, nothing else).  In the second, the value associated with
> the caption key should be spell checked, but nothing else.
> Unfortunately, an editor has no way of knowing which of these
> arguments are commands and which are displayed text.  Something like
> aspell knows about some basic LaTeX commands, and will spell check
> those correctly.  Everything else is guesswork.  Since TeX is Turing-
> complete, the only way of knowing this for certain is to execute the
> program and see if it outputs the text.  TeX has the same limitation
> as PostScript in this respect; the only way of executing page 100 is
> to execute pages 0-99 and discard he result.  Even on a Core 2 Duo,
> it takes a good ten to thirty seconds to typeset a decent length
> document, which is prohibitively expensive for an interactive process
> such as a spell-check-as-you-type feature.

The problem with the page recomputation isn't that much the fact that
TeX is Turing-complete (of course that doesn't help for the reasons
you state) -- it's more because of the layout algorithm, and there's
no real free lunch there, in order to show page 99 you more or less
needs to relayout pages 0-98 ... (not entirely true of course, but you
get the idea..)

> The other disadvantage of this approach is that it's easy to turn
> LaTeX into PDF, but very hard to go the other way.  Even with
> pdfsync, clicking on the PDF will only take you within a paragraph or
> two of the markup that generated a word.
>
> I said earlier that there was a clean separation between semantic
> markup and presentation code, but this isn't really enforced.  TeX
> doesn't do it, LaTeX tries to.  In my own documents, I write using
> semantic markup and then define commands elsewhere that describe how
> to display these, but it requires some effort and discipline to
> maintain this proper level of abstraction.

Exactly; what we really want is a semantic text editor, that lets you
specify semantics for text snippets and let you work on your document
structure as well. The actual editing could show you some graphical
things (eg bold text, a figure...) but it would not be the final
output -- just a visual representation. The final output would be
computed though a proper layout algorithm, etc.

http://camaelon.blogspot.com/2005/11/structured-edition.html

> _The Ugly_
>
> TeX.  TeX is a really hideous language.  Writing TeX feels like
> writing assembly code for a '70s stack-based 8-bit architecture.
> Some ideas from this era died an untimely death, but this was one
> that deserved to be staked, decapitated, had a communion wafer placed
> in its mouth and buried under a crossroads to ensure it never arose
> again.  Any time you need to go below the surface of LaTeX, you are
> in TeX-land, and cursing the lack of anything that even looks a bit
> like a high-level language.

TeX isn't that bad. Really. But the combination of LaTeX and TeX is a
bit odd to deal with, particularly when trying to dig a bit deeper..
;-)

>
> _What We Can Do Better_
>
> The first thing to remove is the in-band signalling that UNIX-users
> love so much.  Because TeX is plain text containing markup, you need
> to insert all of the formatting commands into the text.  We can avoid
> this by placing them in the NSDictionary provided by NSAttributedString.
>
> Doing this also allows us to completely separate markup and
> transformations.  We should define some basic keys (e.g. heading
> depth), and users could add others if they wanted.  We then define
> bundles which perform the transform from the set of semantic tags to
> a set of syntactic ones (we can include things like pulling in code
> from a file and performing syntax highlighting on it as more complex
> examples).
>
> Since we have this nice abstraction, our editor can work much more
> closely with the structure of the document.  We can switch directly
> between different view (semantic / presentation) and have something
> like an outline view for the structure while maintaining things like
> references as links.
>
> There are probably some other things.  Comments?  Suggestions?
> Ramblings?  Flames?

No, it's what we want to do basically. I'd just recap that we want:
- semantic : easily done via tagging, eg vis NSAttributedString keys
- structuration : could be done via tags as well, or perhaps with some
kind of graph structure that would simplify the manipulation of the
document structure, eg having nodes containing nsattributedstring
rather than a single huge nsattributedstring. That's the path I took
when playing with structured edition.
- export : import won't be great as most formats lack semantics,
although we can imagine some good import on docbook-xml, etc.
- export : much easier to do ! we can easily export to HTML, probably
docbook, perhaps OOXML, easily as well to RTF(D) and we can generate
PDF either via the GNUstep text system or via a generated LaTeX (or
even TeX ^_^) file.

-- 
Nicolas Roard
"La perfection, ce n'est pas quand il n'y a plus rien à ajouter, c'est
quand il n'y a plus rien à enlever." -- Antoine de St-Exupéry

_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à