RE: latex <-> xhtml


Subject: RE: latex <-> xhtml
From: Joaquin Cuenca Abela (cuenca@celium.net)
Date: Fri Apr 27 2001 - 09:43:45 CDT


Oliver wrote:

> To keep CONTENT (i.e. "plain" textual data), STRUCTURE (="the DOM") and
> LAYOUT ("style") separated, I used a subset of strict (X)HTML first,
> (without any tags or attributes that would control the layout, but with an
> optional "stylesheet" in mind (XSL or CSS)).
>
> I only used ... :
>
> - rarely some anchors
>
> - heading tags <h1>..</h1> ... <h6>..</h6>
> - paragraph enclosings <p>
> ..
> </p>
> - logic text annotation: <em>..</em>, <strong>..</strong>
> - citations: <cite>..</cite>
> - quotations: <cite>
> ..
> </cite>
>
> I distinguish the latter two for certain reasons: There are citations in
> the flow of text within a paragraph and (bigger) quotations that usually
> appear indented as own "paragraphs" (from a layout point of view). (The
> distinction is not really relevant in html, but it is in LateX) ...
>
> With some pain and not for long I used the <br/>, but it is
> certainly a hack and doesn't fit into the principles I mentioned
> above and disappears from XML anyway ... &->

it can hardly disappears from XML... XML has no bussines with current XML
languages. Ie, <br/> not appears in the XML standard, but in the XHTML one
(and I find hard to believe that they want to deprecate it...).

> At the time being I still check out some "html2latex" command line tools
> but I am not satisfied. Their HTML model seems outdated (no XHTML).

Try HeVeA.

>
> <html> \ \documentclass[]{}
> \ \newcommand{xyz} ...
> <head> > % macro definitions for all
> .bla. > ------------------> % xyz-commands or
> </head> > % xyz.environments
> <body> / % where xyz is an XHTML-tag
> / \begin{document}
>
> <tag>..</tag> >--------------> \tag{..}
>
> <tag> \ \begin{tag}
> .. > ---------------------> ..
> </tag> / \end{tag}
>
> and
>
> <single-tag/> > ---------------> \single-tag % mirrored! .-)
>
> and
>
>
> / \begin{latex-command}
> <latex-command> / ..
> .. < ----------------< \end{latex-command}
> </latex-command> \ OR
> \ \latex-command{ .. }
>

Currently the LaTeX exporter maps abiword built-in styles (header 1, header
2, ..., italic, bold, etc) with LaTeX "report" styles (\section,
\subsection, ...)

There is still no support for export the custom styles that Martin has just
checked in.

Of course, the best way to do it is as you're suggesting, to create a LaTeX
command per custom style.
If my memory serves my right, we already do that for some things that has no
trivial LaTeX counterpart (but I'm not 100% sure :-)

> Of course there is the monster solution with an XML/DOM (dom? .. ;-))
> parser in Java like Xalan or or other languages and the XSLT technology
> for transformation based on DTDs (am I right?) but I don't want to have
> too much trouble with this little thing: I probably will write a tiny
> shell or PERL script to do the conversion, IF THE STYLES IN CURRENT
> ABIWORD (and the filters respecting them) can't do it ...
>
> Concrete QUESTIONs:
>
> * What do you know about the XHTML <-> XML <-> LaTeX conversions
> in Abiword?

you're missing a piece in the puzzle:

XHTML <-> AbiWord --> LaTeX

If AbiWord don't supports something (like tables, for instance) you will not
be able to pass it.
And right now AbiWord can not parse LaTeX files, just write them (it's ~ the
same problem as with html. In the general case is too complex. But maybe
we can try to parse at least the LaTeX files that we produce...)

Dom has been working recently in the XSL-FO <-> AbiWord.

And of course, our own format is also a XML language, so you have:

.abi <-> AbiWord

> * Is there this (maybe tough) requirement to distinguish the "DOM",
> "content" and "style" using XML and XSL in the project?
> * Who has been primarily involved in developing the corresponding
> architecture (the DTD, the filter logics) so far?

the DTD and the filter logic has been there from the very start (to me :-)
I think that the people that has worked the most with the xml stuff are Sam
and Dom.
I've done the most of the work with the LaTeX exporter (with Pierre sending
excellent bug reports :-)

> I wrote a long mail.
> If you reached here, I hope you understand my concern. :-)
>
> looking forward to your reply
>
> cheers
> Oliver
>

cheers,

--
Joaquin Cuenca Abela
cuenca@celium.net

-- Joaquin Cuenca Abela cuenca@celium.net



This archive was generated by hypermail 2b25 : Fri Apr 27 2001 - 09:44:02 CDT