From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101736 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Question on enabling/disabling modes Date: Tue, 28 Aug 2018 11:58:51 +0200 Message-ID: References: <2655E009-8E2A-4015-ABFA-565E52623BD6@elvenkind.com> <42AF8D50-FCF0-48BC-B870-6C66A71DC463@fiee.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7445936091075224289==" X-Trace: blaine.gmane.org 1535450273 12625 195.159.176.226 (28 Aug 2018 09:57:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 09:57:53 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 28 11:57:48 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuakq-00037j-WB for gctc-ntg-context-518@m.gmane.org; Tue, 28 Aug 2018 11:57:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4180B59502; Tue, 28 Aug 2018 11:59:21 +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 g5U8ghHYgMYX; Tue, 28 Aug 2018 11:59:15 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CAE4C594C3; Tue, 28 Aug 2018 11:59:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1B189594C3 for ; Tue, 28 Aug 2018 11:59:15 +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 6CQY72lAAV0u for ; Tue, 28 Aug 2018 11:59:14 +0200 (CEST) Original-Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3EE6D594AF for ; Tue, 28 Aug 2018 11:59:04 +0200 (CEST) Original-Received: by mail-wr1-f54.google.com with SMTP id v17-v6so967822wrr.9 for ; Tue, 28 Aug 2018 02:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=lZkra7SBwm1+PqwIXV81SSYEYWagDFFHdAsQiBgIHDA=; b=eJFK3S7BjK0K6+5N2jWVsP+DMd1ShdLcZCGeZuwBjSD601qZKSVTMfb0Pz5GzPfBGZ saqBrz2e1gK/zbMV9CjWC4B8X7DuD1/Jm3UaUtKqPohU3RBORnLvKxps0tEN+57Fik22 5WiRx/e0hCA7wpaGXZI/jt3T+7KeOc6jr3ukQHH5LGgbvolOegfD+zVAm+4hjLjY2SBw bT6yXnaDgJpWAthOjuS3CwYK6WKN3XSfuixgsinR7gjEdSCuHwfMz9rmht7NXx9YMsQQ vPwhfpJYObmQ7/ESJxl9RHX9D+jlkOpUZGsPBjB3uJDZU7Ihu1z17YZN3uxWxw/1HAj/ kqnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=lZkra7SBwm1+PqwIXV81SSYEYWagDFFHdAsQiBgIHDA=; b=ttTrhzFL+8e9CNmK4hTWq7EZLLF9fKKSkHJE4PHXbx21/wKfIA5eow2puNxDl5ac8n IjWhQ8GSYTEjMq/vOzMbcOuDH17YA2lstnYApyXGQd8Y3ix6arjjcPSEta2y5MWbtFoF vUF47X/2ztAW1HGBVJs+rlQRMvrzNI+zeKALi6wCRHICF15fzDWMEFM2VQSMVf4IXvef B/PmEDcpQaLavKQ9gtLn/CnDI0n0KkpFzvvJ5JqSXlM7DRbkMYhlJ+fUYvneDR5pVZcK cdBQV+/eznaElNS7mP9mXzerkSZnVjmiW05lPqtNhVl6Ym8a4uxUWJzz1RXEx7Uu/kPS KVkQ== X-Gm-Message-State: APzg51BYzXzhqoH57umBUmi9RniNU4UgePRdpKHWn/A621bnQ6w8b+/l 00q1JaGe7pEiyp8xbTJpT6uMHM4NE16YKy1GbNVrDej2 X-Google-Smtp-Source: ANB0VdaJzmAL8UEs0wD6d9cy6uUSQnKy2Yz8siat5t8tumCERdY/cqLom490vxhEuM1T/2HKjkq1QubmKve1R8r3Jq8= X-Received: by 2002:adf:94c5:: with SMTP id 63-v6mr615976wrr.247.1535450343653; Tue, 28 Aug 2018 02:59:03 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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.org gmane.comp.tex.context:101736 Archived-At: --===============7445936091075224289== Content-Type: multipart/alternative; boundary="0000000000004dc53405747be445" --0000000000004dc53405747be445 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mikael, I suppose the files test1 and test2 have a special structure ? %%% file.tex \doifnotmode{test1}{\enablemode[test1,test2]} \starttext \startmode[test1,all] We are in mode test1. \stopmode \startmode[test2,all] We are in mode test2. \stopmode \stoptext %%% %%% test1.tex ???? %%% %%% test2.tex ??? %%% Fabrice Le mar. 28 ao=C3=BBt 2018 =C3=A0 11:05, Mikael P. Sundqvist a =C3=A9crit : > On Tue, Aug 28, 2018 at 10:54 AM Fabrice Couvreur < > fabrice1.couvreur@gmail.com> wrote: > >> Hi Mikael, >> I do not know this way yet. Can you attach a complete example ? >> Regards, >> Fabrice >> >> Le lun. 27 ao=C3=BBt 2018 =C3=A0 20:47, Henning Hraban Ramm a >> =C3=A9crit : >> >>> Am 2018-08-27 um 16:37 schrieb Mikael P. Sundqvist : >>> >>> > > On 27 Aug 2018, at 14:14, Mikael P. Sundqvist >>> wrote: >>> > > >>> > > Hi! >>> > > >>> > > I am writing notes for my teaching and would like to do the >>> following with modes: >>> > > >>> > > * If the file is compiled with context file.tex then everything >>> (i.e. the content in all modes) is typeset. >>> > > * If the file is compiled with context --mode=3Dtest1 file.tex then >>> only mode test1 is typeset. >>> > > >>> > > I do not see how to do this easily. >>> > >>> > >>> > This is what I would do if the list of modes is small: >>> > >>> > \doifnotmode{test1}{\enablemode[test1,test2]} >>> > >>> > (and don=E2=80=99t use the \definemode lines) >>> > >>> > But if you need many of them, that could get problematic with >>> > many nested \doifmodeelse statements. >>> > >>> > In that case, I would use a separate =E2=80=98all=E2=80=99 mode, and = call the >>> > context script with that as argument in the generic case. >>> > >>> > >>> > %%% file.tex >>> > \starttext >>> > \startmode[test1,all] >>> > We are in mode test1. >>> > \stopmode >>> > \startmode[test2,all] >>> > We are in mode test2. >>> > \stopmode >>> > \stoptext >>> > %%% >>> > >>> > >>> _______________________________________________________________________= ____________ >>> > >>> > Thank you, Taco! >>> > >>> > I have around 25 of them, and your solution with "all" works indeed >>> well for me. >>> >>> >>> There=E2=80=99s also >>> >>> \startnotmode[some] >>> This is not typeset in "some" mode. >>> \stopnotmode >>> >>> >>> Greetlings, Hraban >>> --- >>> https://www.fiee.net >>> http://wiki.contextgarden.net >>> https://www.dreiviertelhaus.de >>> GPG Key ID 1C9B22FD >>> >>> >>> _______________________________________________________________________= ____________ >>> 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://context.aanhet.net >>> archive : https://bitbucket.org/phg/context-mirror/commits/ >>> wiki : http://contextgarden.net >>> >>> _______________________________________________________________________= ____________ >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> >> ________________________________________________________________________= ___________ > > > Fabrice, > > Taco's example is complete. Try > > context file.tex > context --mode=3Dtest1 file.tex > context --mode=3Dall file.tex > > and you will get, in turn, nothing, the content in mode test1, everything= . > > /Mikael > > _________________________________________________________________________= __________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ --0000000000004dc53405747be445 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Mikael,
I suppose the files test1 and test2 have a s= pecial structure ?

%%% file= .tex
\doifnotmode{test1}{\enablemode[test1,test2]}
= \starttext
\startmode[test1,all]
We are in mode test1.
\stopmode\startmode[test2,all]
We are in mode test2.
\stopmode
\stoptext<= br>
%%%

<= div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">%%% test1.tex
????
%%%

%%% test2.tex
?= ??
%%%

= Fabrice

Le=C2=A0mar. 28 ao=C3=BBt 2018 =C3=A0=C2=A011:05, Mikael P. Sundq= vist <mickep@gmail.com> a =C3= =A9crit=C2=A0:
On Tue, Aug 28, 2018 at 10:54 AM F= abrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
Hi Mikael,
I do not know this way yet. Can you attac= h a complete example ?
Regards,
Fabrice

Le=C2= =A0lun. 27 ao=C3=BBt 2018 =C3=A0=C2=A020:47, Henning Hraban Ramm <texml@fiee.net> a =C3= =A9crit=C2=A0:
Am 2018-08-27 um 16:= 37 schrieb Mikael P. Sundqvist <mickep@gmail.com>:

> > On 27 Aug 2018, at 14:14, Mikael P. Sundqvist <mickep@gmail.com> wrote:
> >
> > Hi!
> >
> > I am writing notes for my teaching and would like to do the follo= wing with modes:
> >
> > * If the file is compiled with context file.tex then everything (= i.e. the content in all modes) is typeset.
> > * If the file is compiled with context --mode=3Dtest1 file.tex th= en only mode test1 is typeset.
> >
> > I do not see how to do this easily.
>
>
> This is what I would do if the list of modes is small:
>
> \doifnotmode{test1}{\enablemode[test1,test2]}
>
> (and don=E2=80=99t use the \definemode lines)
>
> But if you need many of them, that could get problematic with
> many nested \doifmodeelse statements.
>
> In that case, I would use a separate =E2=80=98all=E2=80=99 mode, and c= all the
> context script with that as argument in the generic case.
>
>
> %%% file.tex
> \starttext
> \startmode[test1,all]
> We are in mode test1.
> \stopmode
> \startmode[test2,all]
> We are in mode test2.
> \stopmode
> \stoptext
> %%%
>
> ______________________________________________________________________= _____________
>
> Thank you, Taco!
>
> I have around 25 of them, and your solution with "all" works= indeed well for me.


There=E2=80=99s also

\startnotmode[some]
This is not typeset in "some" mode.
\stopnotmode


Greetlings, Hraban
---
https= ://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

Fabrice,

= Taco's example is complete. Try

context file.t= ex
context --mode=3Dtest1 file.tex
context --mode=3Dall= file.tex

and you will get, in turn, nothing, the = content in mode test1, everything.

/Mikael
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________ --0000000000004dc53405747be445-- --===============7445936091075224289== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============7445936091075224289==--