From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77173 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: clutter with \start and \stop Date: Thu, 5 Jul 2012 10:23:40 +0200 Message-ID: References: <87fw98e9wl.fsf@micropit.couberia.bzh> <4FF3F9A5.2070107@wxs.nl> <87wr2jclse.fsf@micropit.couberia.bzh> <16AB29D5-539E-4639-A2F9-631D9FBDBB1E@emory.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1091930947==" X-Trace: dough.gmane.org 1341476629 19800 80.91.229.3 (5 Jul 2012 08:23:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2012 08:23:49 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 05 10:23:48 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SmhLo-00076k-LU for gctc-ntg-context-518@m.gmane.org; Thu, 05 Jul 2012 10:23:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4022E101DF; Thu, 5 Jul 2012 10:23:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CZ355si2qO68; Thu, 5 Jul 2012 10:23:45 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7E990101F8; Thu, 5 Jul 2012 10:23:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 55B33101F8 for ; Thu, 5 Jul 2012 10:23:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MXB56Bc32mAT for ; Thu, 5 Jul 2012 10:23:43 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 32EB6101DF for ; Thu, 5 Jul 2012 10:23:43 +0200 (CEST) Original-Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q658NfIa028752 for ; Thu, 5 Jul 2012 10:23:41 +0200 Original-Received: by obhx4 with SMTP id x4so10718379obh.14 for ; Thu, 05 Jul 2012 01:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cqzicHcsaDtmXcpC5fiNlJxqfDXyhQJj8/+XQflw7gg=; b=S+gFo69EQs0WxPhmKOhIiZeOVmSsCRUBExWX8YoS3Rc6+uoh/rUMYPwevVAhtrhY/R Nf3MYtpdF7kiSKbdkS2ZEWajMg7SyGtcU/rXO9FoPv3QJB0R5EamGs69ExKwGhu2K096 AyaOaiOn3XEjlJlMd5gAjuO1GxmHLfffnM/AuOj2e7munGxfLZrTCh/HtPjyfbr+OEdv CeE9lwgKwC4pLLacrJQn4VgO1Yjk71Yoc6dNGNLeYk9kOOOpHcifuEcof+F6PRiNnVDG gK954MpH9mghx9Eoi+y61koGfrmj2+2VQQFhUNXl9o/+74PliqN13KulpZQ+jTP1+dJF Nh8w== Original-Received: by 10.182.86.225 with SMTP id s1mr16839286obz.73.1341476620338; Thu, 05 Jul 2012 01:23:40 -0700 (PDT) Original-Received: by 10.182.74.231 with HTTP; Thu, 5 Jul 2012 01:23:40 -0700 (PDT) In-Reply-To: <16AB29D5-539E-4639-A2F9-631D9FBDBB1E@emory.edu> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QHuwnF4h - b95ce483ad65 - 20120705 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77173 Archived-At: --===============1091930947== Content-Type: multipart/alternative; boundary=f46d0444e9d16e079304c410dd2d --f46d0444e9d16e079304c410dd2d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 5, 2012 at 12:44 AM, Rogers, Michael K wrote= : > On Jul 4, 2012, at 1:29 PM, Peter M=C3=BCnster wrote: > > On Wed, Jul 04 2012, Hans Hagen wrote: > > > >> no, mixing this way is asking for troubles, if not now, than maybe in > the > >> future > >> > >> just use \section > > > > Yes, but isn't \startsection the recommended method for the future and > > needed for XML output? > > XML documents should form a tree, so a structure like > > \startA % > \startB % > \stopA % > \stopB % > > 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 resto= re > 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 retu= rn > 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 =3D textAA =E2=8B=83 textAB content of \startB..\stopB =3D textAB =E2=8B=83 textBB \startA..\stopA =E2=8B=82 \startB..\stopB =3D textAB If we are describing programs, textAB can be the common code between the function A and B. --=20 luigi --f46d0444e9d16e079304c410dd2d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Thu, Jul 5, 2012 at 12:44 AM, Rogers,= Michael K <mroge02@emory.edu> wrote:
On Jul 4, 2012, at 1:29 PM, Peter M=C3=BCnster wrote:
> On Wed, Jul 04 2012, Hans Hagen wrote:
>
>> no, mixing this way is asking for troubles, if not now, than maybe= in the
>> future
>>
>> just use \section
>
> Yes, but isn't \startsection the recommended method for the future= and
> needed for XML output?

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... b= ehave like \begingroup and \endgroup. =C2=A0The \stop... is supposed to res= tore the state before the corresponding \start... (at least I assume so -- = \endgroup works that way). =C2=A0One cannot stop A in the middle of B and r= eturn to the state before \startA without also stopping B. =C2=A0So one sho= uld put \stopB before \stopA, not after it.

It depends.

\starttext<= /div>
\long\def\startA#1\stopA{<\low{A}#1>\low{A}}
\lon= g\def\startB#1\stopB{<\low{B}#1>\low{B}}

\startA
textAA
\startB
textAB
\stop= A
textBB
\stopB
\stoptext

is ok =C2=A0(not the context way, btw:=C2=A0real= code is more complex).


The meaning of this can be
content of \= startA..\stopA =3D textAA =E2=8B=83 textAB
content of \start= B..\stopB =3D textAB =E2=8B=83 textBB
\startA..\stopA=C2=A0= =E2=8B=82 =C2=A0\startB..\stopB =3D textAB

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



--
luigi

--f46d0444e9d16e079304c410dd2d-- --===============1091930947== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1091930947==--