# [NTG-context] clutter with \start and \stop

Rogers, Michael K mroge02 at emory.edu
Thu Jul 5 15:40:57 CEST 2012

On Jul 5, 2012, at 1:23 AM, luigi scarso wrote:
On Thu, Jul 5, 2012 at 12:44 AM, Rogers, Michael K <mroge02 at emory.edu<mailto:mroge02 at emory.edu>> wrote:
XML documents should form a tree, so a structure like

\startA % <A>
\startB % <B>
\stopA % </A>
\stopB % </B>

won't translate to XML.

Grouping in TeX follows the same restrictions, and \start... and \stop... behave like \begingroup and \endgroup.  The \stop... is supposed to restore the state before the corresponding \start... (at least I assume so -- \endgroup works that way).  One cannot stop A in the middle of B and return to the state before \startA without also stopping B.  So one should put \stopB before \stopA, not after it.

It depends.

\starttext
\long\def\startA#1\stopA{<\low{A}#1>\low{A}}
\long\def\startB#1\stopB{<\low{B}#1>\low{B}}

\startA
textAA
\startB
textAB
\stopA
textBB
\stopB
\stoptext

is ok  (not the context way, btw: real code is more complex).

The meaning of this can be
content of \startA..\stopA = textAA ⋃ textAB
content of \startB..\stopB = textAB ⋃ textBB
\startA..\stopA ⋂  \startB..\stopB = textAB

If we are describing programs, textAB can be the common code between the function A and B.

--
luigi

Again, I agree with what you write.  Somewhere I must have expressed myself poorly and I apologize.  It seems like a side issue (my issue with XML), and I did not mean to hijack the thread.  Sorry.

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.