From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/107639 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Fabrice L Newsgroups: gmane.comp.tex.context Subject: Re: start/stop executed conditionally on mode ? Date: Mon, 8 Jun 2020 10:54:37 -0400 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: multipart/mixed; boundary="===============8660969061439219211==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73631"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 08 16:55:11 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiJB9-000J3v-1w for gctc-ntg-context-518@m.gmane-mx.org; Mon, 08 Jun 2020 16:55:11 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6DB1F1849D1; Mon, 8 Jun 2020 16:54:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RJfemzd6Osf1; Mon, 8 Jun 2020 16:54:43 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AC6521849CD; Mon, 8 Jun 2020 16:54:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4EECC1849CD for ; Mon, 8 Jun 2020 16:54:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XlY0xdSyqsFF for ; Mon, 8 Jun 2020 16:54:41 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.173; helo=mail-qk1-f173.google.com; envelope-from=fabrice.alpha@gmail.com; receiver= Original-Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 88DEB1849C7 for ; Mon, 8 Jun 2020 16:54:41 +0200 (CEST) Original-Received: by mail-qk1-f173.google.com with SMTP id n11so17492939qkn.8 for ; Mon, 08 Jun 2020 07:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=IkfT2ZxDIQZ0yJ3VysvNaSlcxn1cd+vHTZEHXfMTp+I=; b=puB53rmlixL0TvDBaKcs4IknnK29H0mrLLEJ7yARvphKMrcMi8VLg0ej5fwrnqPPdZ p4gP9LBBeaq0cSKEq5B6tAXOjZtSsOl6yuVQ3ZW2fbubnwZidWdOgcS+iGRsVgG+uG6M 2UhYbA8J/cmKcoy2HqzIjhjMtCfy/QpE+bijoVYJYSj4DfAhQsWmh9rmqP0ypA2gNyTT h5aEhB5BKXU5wf2ES8/6lp3MvxH7UO9Kru1WsrGN/zHNizLNurVy+X/AUNffShM9AJrR dFjZLNsTA7Lo0Xi87/+ylk0e1cJoMxbLOj2HZyLs4cb035P9tulXdYwU+/9B/A3/9tHo SuLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=IkfT2ZxDIQZ0yJ3VysvNaSlcxn1cd+vHTZEHXfMTp+I=; b=EHWoBZ+glN2oVr9oL1r1c1cOCkeWCtAjrMC0GPOt9LusLn640I5yTznnl4MBjvm3Fb 9HhcXn1TIbnMl6X14mZSw3lBRse+/7BNcFLpdFPyMc910ZpMLaB6mLa3oXPvutL6Av3T zgT0dJVijIgOC5AW72YqHUCy9ZiKcPmkMXcEo8j5CfFxuMhaJ/Ba4wdUwMUrGgD4wEU5 p3bhIBsudj/jfPxYMrq0EXx/xFw723khhY1XxLnIoe07hQPqhIo/i5Guq82oZ1ZT//RD iVAIUzgrSnzHH/ilbkdbvoWDLAJKK3WU+FM6exJYKgW+QRqoTZ2i4l/ERUkZO0KhmfmB l00A== X-Gm-Message-State: AOAM531mD+x/LwDv4XZ4lNpQx5QgYJXIAHPB4C7yxs0dmu57n+4w/PCN TbDawi1vZcp3Jhg/UbrH5O1bj80y X-Google-Smtp-Source: ABdhPJzZAvHtAFtQeDFIofxqXDvp/6IMN7XVayApIk/Um8lJWppAbhgLdgDzvJ1KZuz7IRM9UmQ7pg== X-Received: by 2002:a05:620a:4e2:: with SMTP id b2mr22999228qkh.16.1591628079434; Mon, 08 Jun 2020 07:54:39 -0700 (PDT) Original-Received: from [192.168.86.243] ([38.74.28.141]) by smtp.gmail.com with ESMTPSA id t13sm7908511qtc.77.2020.06.08.07.54.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2020 07:54:38 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:107639 Archived-At: --===============8660969061439219211== Content-Type: multipart/alternative; boundary="Apple-Mail=_DC82C0AA-5E68-4F1D-B2F1-7233D2FB23AE" --Apple-Mail=_DC82C0AA-5E68-4F1D-B2F1-7233D2FB23AE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Aditya, > Le 7 juin 2020 =C3=A0 23:19, Aditya Mahajan a = =C3=A9crit : >=20 > On Sun, 7 Jun 2020, Fabrice L wrote: >=20 >> Dear List, >>=20 >> I would like to insert a page using (ideally) start/stop = instructions. The problem is that this page should be inserted only in a = certain mode. Consulting the mailing list, I thought the following code = was working, but it=E2=80=99s not ! The code is executed in the mode as = expected, but the following instructions ("Some other text... =C2=BB in = the exemple) is not typeset. >>=20 >> Here is a minimal (not working!) example: >>=20 >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >> \unexpanded\def\StartQuestionsList{ >> \startmode[ClassRoom] \page[yes] Here are some questions: = \blank >> } >> \unexpanded\def\StopQuestionsList{ >> \page[yes] \stopmode >> } >> \definestartstop[Questions][ >> before=3D\StartQuestionsList, >> after=3D\StopQuestionsList >> ] >>=20 >>=20 >> \startQuestions >> Question A=E2=80=A6. >> Question B=E2=80=A6. >> \stopQuestions >>=20 >> Some other text... >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >>=20 >>=20 >> So to be clear, I would like the result in the =C2=AB ClassRoom =C2=BB = mode to be: >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >> Here are some questions: >>=20 >> Question A=E2=80=A6. >> Question B=E2=80=A6. >>=20 >> Some other text... >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >>=20 >> Otherwise to be: >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >> Some other text... >> % = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 >=20 > If you only set `ClassRoom` mode at compile time (rather than setting = and unsetting it the middle of the document), then you can do: >=20 > \definebuffer[Questions] >=20 > \startmode[ClassRoom] > \define\StopQuestionsList {...} >=20 > \definestartstop[Questions][...] > \stopmode >=20 Thanks for your answer, I will try that. Fabrice, --Apple-Mail=_DC82C0AA-5E68-4F1D-B2F1-7233D2FB23AE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = Aditya,

Le 7 juin 2020 =C3=A0 23:19, Aditya Mahajan = <adityam@umich.edu> a =C3=A9crit :

On Sun, 7 Jun 2020, Fabrice L = wrote:

Dear = List,

I would like to insert a page using = (ideally) start/stop instructions. The problem is that this page should = be inserted only in a certain mode. Consulting the mailing list, I = thought the following code was working, but it=E2=80=99s not ! The code = is executed in the mode as expected, but the following instructions = ("Some other text... =C2=BB in the exemple) is not typeset.

Here is a minimal (not working!) example:

% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
\unexpanded\def\StartQuestionsList{
= \startmode[ClassRoom]  \page[yes] Here are some questions: = \blank
}
\unexpanded\def\StopQuestionsList{ = \page[yes] \stopmode
}
\definestartstop[Questions][
= before=3D\StartQuestionsList,
= after=3D\StopQuestionsList
]


\startQuestions
= Question A=E2=80=A6.
Question B=E2=80=A6.
\stopQuestions

Some other = text...
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94


So = to be clear, I would like the result in the =C2=AB ClassRoom =C2=BB mode = to be:
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
Here are some questions:

Question A=E2=80=A6.
= Question B=E2=80=A6.

Some other = text...
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94

Otherwise to = be:
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94
Some other text...
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94

If you only set `ClassRoom` mode = at compile time (rather than setting and unsetting it the middle of the = document), then you can do:

\definebuffer[Questions]

\startmode[ClassRoom]
\define\StopQuestionsList {...}

\definestartstop[Questions][...]
\stopmode


Thanks for your answer, I will try that.
Fabrice,


= --Apple-Mail=_DC82C0AA-5E68-4F1D-B2F1-7233D2FB23AE-- --===============8660969061439219211== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8660969061439219211==--