On Sun, 10 Jun 2007, Pepe Barbe wrote:

> Hello,
>
> I have used ConTeXt in the past and I have been very pleased with it
> and the results obtained, much more than LaTeX.
>
> Now I am looking into a solution that would allow me to layout the
> content ConTeXt and in other formats that ConTeXt does not (Forgive my
> ignorance, if I am wrong) output, like HTML, Plain Text, or RTF (Those
> are the formats that I can think of that are interesting to me
> currently).
>
> Reading the Wiki one of those solutions would be XML, but I know very
> little about the subject, so this email is to ask about experiences in
> similar endeavors, other solutions for the same problem and how
> practical this is.

I have been exploring for something like this, but unfortunately have 
not found anything completely satisfactory. For "simple" documents, 
that is, only text, XML is the easiest. You have to determine a xml 
dtd, and then it is relatively easy to write context commands to parse 
it. It is also easy (but slightly cumbersome) to write a xsl 
stylesheet to parse xml into html. Most browsers do the xslt 
transformation on the fly. I found xml+css to be the easiest way to 
go, since you can do almost a one-to-one mapping of your ConTeXt 
commands. But most xml websites say that it is the "old" method and 
should not be used.

To get plain text, you can do lynx -dump or something similar. I am 
sure there will be ways to convert xml to rtf, but I have not explored 
them.

Some of the difficulties that I faced with simple documents was:

1. What is the xml equivalent of ||
2. What is the xml equivalent of ~ (  ??)
3. What is the xml equivalent of

\abbreviation {EECS} {Electrical Engineering and Computer Science}
and then \EECS\ and \infull{EECS}.

I did not have time to explore further, so I left my xml experiments 
there. For me the hardest part was to learn the xml way of thinking.


> I suppose that I would use this for general writing and for academic
> as well (Maths and engineering).

For more complext documents (esp math), I do not like xml as an input 
format. Mathml is too verbose for me to write. Then there is the 
question of how useful is it to have a xml + mathml document. ConTeXt 
can parse it, and so can some of the browsers, but most browsers can 
not. Converting to html + images looks ugly, unless you put in a lot 
of effort. I have not tried converting xml+mathml to rtf or some 
office format. For complicated documents, I do not see the use of 
having an xml document. Most people are happy receiving a pdf. If 
someone wants to edit my files, and cannot edit tex file, he/she will 
not be able to edit xml files. If they use an office application to 
edit the file, I will need to backport the modifications manually. So 
he/she might as well use pdf annotation tools.


If you do want to explore furhter, perhaps the easiest way is to use 
tex4ht, which does a decent job with most context documents and can 
convert to html, xml, and open office format. I do not like tex4ht 
because its html output is too verbose, and its documentation is a bit 
hard to follow.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to