# [NTG-context] About Thomas Schmitz My Way

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Wed Mar 10 13:50:31 CET 2010

Hi Otared,

thanks for the feedback and the kind words!

On Mar 10, 2010, at 12:54 PM, Otared Kavian wrote:
>
> Regarding the tutorial you have written, although the typo may be corrected by any cautious reader, I think that, on page 2, lines 5 and 6 of your My Way it should be
> </body>
> </html>
>

Of course! Thanks for spotting this.

> I don't know whether the following observation is correct or not: I had to add at the beginning of the file « ourenvironment.tex » which must contain the xml setups, the command
> \startenvironment ourenvironment
>
> and at the end of that file:
> \stopenvironment
>
> before being able to get what you describe. The curious thing is that even when I didn't add
> \startenvironment ourenvironment
> \stopenvironment
> the xml file was processed by ConTeXt. For beginners like me, I think this should be said clearly somewhere.
>

Really? No, I don't think you need to have this. When I process

context --environment=ourenvironment ourfile.xml

it gets processed even without the \start \stop pair you describe.

> Also, in order to have a better PDF in your examples, at some point I understood that in order to have appropriate white space between paragraphs and tables one could, or should, add the tag for preformatted text:
> <pre>
>
> </pre>
>
> and transform it into \blank by ConTeXt. To this end one has to add the tag  pre to \xmlsetup:
> \xmlsetsetup{\xmldocument}{html|body|h1|h2|p|em|q|b|table|tr|th|td|pre}{xml:*}
>
> and then
> \startxmlsetups xml:pre
> 	\xmlflush{#1}\blank[big]
> \stopxmlsetups
>
> to the environment.
>
Yes, I was bothered by the lack of whitespace too, but I wanted to keep it simple. adding <pre> would be one way; another way would be to add something like \blank[line]\par at the end of the setup commands. But I wasn't sure what would be more confusing to beginners: the somewhat ugly output or these additions.

> Finally a qusetion: is there a way to obtain an xml file from a rather simple TeX source, written with ConTeXt commands? Here by simple I mean something which contains text and math formulas, such as a list of problems and exercises.
>
That's a very interesting question. Hans has this intriguing paragraph in the older manual, example.pdf: "In ConTEXt we use a strange but charming way to handle this conversion: we simply typeset xml. The typeset document (with lots of angle brackets) is then converted into raw text. A complication is math, but given that you can embed MathML in your document, this can be passed on directly." The question how this can be done has been asked several time on the list, but so far, I haven't seen an answer. Maybe you need to buy Hans lots of beer at the next ConTeXt meeting, and he will finally fess up!

Thanks, and best wishes

Thomas