From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113576 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fabrice L via ntg-context Newsgroups: gmane.comp.tex.context Subject: Blocks inside a conditional mode. Date: Sun, 28 Nov 2021 13:39:27 -0500 Message-ID: <31350963-95D3-421F-A069-CDE1D9730DF3@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Content-Type: multipart/mixed; boundary="===============3552766645027237039==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14943"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Fabrice L To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Nov 28 19:40:01 2021 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 1mrP5i-0003YS-59 for gctc-ntg-context-518@m.gmane-mx.org; Sun, 28 Nov 2021 19:39:58 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C2E43285887; Sun, 28 Nov 2021 19:39:35 +0100 (CET) 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 cXw0LIzZXMaJ; Sun, 28 Nov 2021 19:39:34 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 087C6286933; Sun, 28 Nov 2021 19:39:34 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BA8BD282543 for ; Sun, 28 Nov 2021 19:39:32 +0100 (CET) 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 fyNLJazjmVRw for ; Sun, 28 Nov 2021 19:39:31 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.160.173; helo=mail-qt1-f173.google.com; envelope-from=fabrice.alpha@gmail.com; receiver= Original-Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.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 9CE872807BE for ; Sun, 28 Nov 2021 19:39:31 +0100 (CET) Original-Received: by mail-qt1-f173.google.com with SMTP id 8so14153460qtx.5 for ; Sun, 28 Nov 2021 10:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:message-id:date:to; bh=9B5ZKznj7c+g8JbCetNZtGfFSJdeyRvZcii9UAKuUxk=; b=qim8Yj3Gb+UbmR0zIXtuaI7EWZEgVH50S4sPXSDLeQSWCpOBXzGB5c0aXAIUEr1/W6 OPLIPnFUB9ZxEPjNxdEROJ8LS4vTj09A53fSjTjRMa9BmBOxguZczm0cTVu13LEja9HA bUjMbatOsawxELOx6ozLnyYj6mi1+CwL9acTj54U4WfKhUFrg3iF8HOECqibnhq3aEan ksPBZjsNmMFLI5c6ZqT0YfNSqyS16tB0U51VJtAoHoIZzPZqyhqV7jjGPI1eoW1Wkl5E FzykTspHiyDXNQQWRGnZxDf1kEN+8GkLvCZVPEtoARUuamlKH3s8/Gk6VpHQjaotxM4i UuRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=9B5ZKznj7c+g8JbCetNZtGfFSJdeyRvZcii9UAKuUxk=; b=OT6mMqUKHmEcd20HP5nLPoOKd5Y05BMyCO5j4G/qO8ho2/MHgYy4PwanvpVhIdvBYd V027TQwWAPLN756InKxhN0K1AtadRJGY16DO/ws0n6a9yKifb5GuxvEN0QcRffpakb0o 60RpRovodjsIuewYa+/SRniMIBkh/WA5z5bqOlmicDCKZuV7s91MiRLpzukgg2qSsA49 +tRgbkj88W6iz1zcJLGiX9CVpuIqirXWInEHtBJo0PfsLD8iLJhG59VfNHwh4vsQzOvr vMFIXECz2hK6lsIDH6+cliCeF6duv/jgMedPQ1Tp8JT6uLvt/vyFjxZR4J0GCp0wUkRB N2kQ== X-Gm-Message-State: AOAM533sw64gl3cXnBdlHSW17JRG+NLTlYAKde7XpZtwCMJOVn9cVMDj gwZzfqCWPCuSaIwdpoUepfb3XXanZT4= X-Google-Smtp-Source: ABdhPJwtJSRtCULGxe2OOd5h2zqkfPGknxOu26SzEJpTq+aoMkY75AQcXa0P3JcrIGGKy6DKYNuCUQ== X-Received: by 2002:a05:622a:178c:: with SMTP id s12mr37982343qtk.156.1638124769652; Sun, 28 Nov 2021 10:39:29 -0800 (PST) Original-Received: from smtpclient.apple ([38.74.28.141]) by smtp.gmail.com with ESMTPSA id bs16sm7196541qkb.45.2021.11.28.10.39.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Nov 2021 10:39:28 -0800 (PST) X-Mailer: Apple Mail (2.3693.20.0.1.32) 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:113576 Archived-At: --===============3552766645027237039== Content-Type: multipart/alternative; boundary="Apple-Mail=_8351EA78-3FC6-45DC-B69D-E70BE7E2F046" --Apple-Mail=_8351EA78-3FC6-45DC-B69D-E70BE7E2F046 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear list, I have an error when I try to insert a block inside a conditional mode = (but there is two nested conditional mode.. is this the problem ?). =20 In my courses notes, I insert some blocks (named =C2=AB Complement =C2=BB= in the minimal exemple below) when in =C2=AB Professor =C2=BB mode. = This works fine, as shown in the first =C2=AB \beginComplement =E2=80=A6 = \endComplement =C2=BB of my example below.=20 But now I have to use another condition for some blocks, depending of = the number of the current course. So I insert my block with a condition, = here =C2=AB CourseOne =C2=BB : \enablemode[CourseOne] \doifmode{CourseOne}{ \beginComplement Another complementary slide.=20 \endComplement } But this does not work : % =E2=80=94=E2=80=94=E2=80=94=E2=80=94 tex error > tex error on line 1 in file = /Users/fabricel/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.m= kiv: ! TeX capacity exceeded, sorry [input stack size=3D50000] % =E2=80=94=E2=80=94=E2=80=94=E2=80=94 The problem can be summarized in this minimal non working example :=20 % =E2=80=94 MWE = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \setuppapersize[S5][S5] \enablemode[Professor] \defineblock[Complement] \setupblock[Complement][ = before=3D{\page[yes]\setuppagenumber[state=3Dstop]\setupheadertexts[]\setu= pbackgrounds[page][background=3Dcolor,backgroundcolor=3Dred]}, after=3D{\page[yes]\setuppagenumber[state=3Dstart]}] \doifallmodes{Professor} { \keepblocks[Complement] } \starttext page 1 =09 \beginComplement A complementary slide.=20 \endComplement page 2 \enablemode[CourseOne] \doifmode{CourseOne}{ \beginComplement Another complementary slide but only for course number = 1.=20 \endComplement } \disablemode[CourseOne] page 3 \enablemode[CourseTwo] \doifmode{CourseTwo}{ \beginComplement Another complementary slide but only for course number = 2.=20 \endComplement } \disablemode[CourseTwo] \stoptext \stoptext % =E2=80=94 MWE = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Blocks and modes usually works fine for me, but here, I do not = understand my error. Thanks for any help !=20 Fabrice.=20 Note : in case this way of doing things seems a bit silly, here are more = explanations. I do use mode =C2=AB CourseOne =C2=BB here because in the = real life, the content in the condition =C2=AB \doifmode{CourseOne}{ = =E2=80=A6} =C2=BB is read in an external file, containing material for = =C2=AB CourseOne =C2=BB, =C2=AB CourseTwo =C2=BB, etc. The setup is = then, in the main file : % Main file : begin ---------------- Bla bla bla ... \enablemode[CourseOne] \input ComplementMaterial.tex \disablemode[CourseOne] Bla bla bla ... \enablemode[CourseOne] \input ComplementMaterial.tex \disablemode[CourseOne] % Main file : end ---------------- And in the =C2=AB ComplementMaterial.tex =C2=BB there is : % ComplementMaterial.tex =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94 \doifmode{CourseOne}{ \beginComplement A complementary slide but only for course number 1.=20 \endComplement \beginComplement Another complementary slide but only for course number = 1.=20 \endComplement } \doifmode{CourseTwo}{ \beginComplement A complementary slide but only for course number 2.=20 \endComplement \beginComplement Another complementary slide but only for course number = 2.=20 \endComplement } % ComplementMaterial.tex =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94 --Apple-Mail=_8351EA78-3FC6-45DC-B69D-E70BE7E2F046 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Dear list,

I have an error when I try to insert a block inside a = conditional mode (but there is two nested conditional mode.. is this the = problem ?).  

In my courses notes, I insert some blocks (named =C2=AB  = Complement =C2=BB in the minimal exemple below) when in = =C2=AB Professor =C2=BB mode. This works fine, as shown in the = first =C2=AB  \beginComplement =E2=80=A6 = \endComplement  =C2=BB of my example below. 

But now I have to use = another condition for some blocks, depending of the number of the = current course. So I insert my block with a condition, here = =C2=AB CourseOne =C2=BB :

= \enablemode[CourseOne]
= \doifmode{CourseOne}{
= \beginComplement
= Another complementary slide. 
= \endComplement
}

But this does not work :

% =E2=80=94=E2=80=94=E2=80= =94=E2=80=94
tex error     =   > tex error on line 1 in file = /Users/fabricel/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.m= kiv: ! TeX capacity exceeded, sorry [input stack = size=3D50000]
% = =E2=80=94=E2=80=94=E2=80=94=E2=80=94

The problem can be = summarized in this minimal non working example : 

% =E2=80=94 MWE = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
\setuppapersize[S5][S5]
\enablemode[Professor]

\defineblock[Complement]
\setupblock[Complement][
= before=3D{\page[yes]\setuppagenumber[state=3Dstop]\setupheadertexts= []\setupbackgrounds[page][background=3Dcolor,backgroundcolor=3Dred]},
= = after=3D{\page[yes]\setuppagenumber[state=3Dstart]}]
\doifallmodes{Professor} {
    = \keepblocks[Complement]
}

\starttext

page 1
=
\beginComplement
= A complementary slide. 
= \endComplement

= page 2

= \enablemode[CourseOne]
= \doifmode{CourseOne}{
= \beginComplement
= Another complementary slide but only for course number = 1. 
\endComplement
= }
\disablemode[CourseOne]

page = 3

= \enablemode[CourseTwo]
= \doifmode{CourseTwo}{
= \beginComplement
= Another complementary slide but only for course number = 2. 
\endComplement
= }
= \disablemode[CourseTwo]

\stoptext
\stoptext

% =E2=80=94 MWE = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

Blocks and modes usually works fine for = me, but here, I do not understand my error.
Thanks = for any help ! 

Fabrice. 


Note : in case this way = of doing things seems a bit silly, here are more explanations. I do use = mode =C2=AB CourseOne =C2=BB  here because in the real = life, the content in the condition =C2=AB  \doifmode{CourseOne}{ = =E2=80=A6} =C2=BB is read in an external file, containing material = for =C2=AB CourseOne =C2=BB, =C2=AB CourseTwo =C2=BB, = etc. The setup is then, in the main file :

% Main file : begin = ----------------

Bla bla bla ...

\enablemode[CourseOne]
\input = ComplementMaterial.tex
\disablemode[CourseOne]

Bla bla bla = ...

\enablemode[CourseOne]
\input = ComplementMaterial.tex
\disablemode[CourseOne]

% Main file : end = ----------------

And in the =C2=AB ComplementMaterial.tex =C2=BB = there is :

% = ComplementMaterial.tex =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94

= \doifmode{CourseOne}{
= \beginComplement
A = complementary slide but only for course number 1. 
= \endComplement

= \beginComplement
= Another complementary slide but only for course number = 1. 
\endComplement
= }

\doifmode{CourseTwo}{
= \beginComplement
A = complementary slide but only for course number 2. 
= \endComplement

= \beginComplement
= Another complementary slide but only for course number = 2. 
\endComplement
= }
% ComplementMaterial.tex = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94

= --Apple-Mail=_8351EA78-3FC6-45DC-B69D-E70BE7E2F046-- --===============3552766645027237039== 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== --===============3552766645027237039==--