From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101734 Path: news.gmane.org!.POSTED!not-for-mail From: "Mikael P. Sundqvist" Newsgroups: gmane.comp.tex.context Subject: Re: Question on enabling/disabling modes Date: Tue, 28 Aug 2018 11:04:55 +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="===============7060152248065512707==" X-Trace: blaine.gmane.org 1535447058 4076 195.159.176.226 (28 Aug 2018 09:04:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 09:04:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 28 11:04:14 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 1fuZv3-0000yO-SQ for gctc-ntg-context-518@m.gmane.org; Tue, 28 Aug 2018 11:04:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F2196595ED; Tue, 28 Aug 2018 11:05:36 +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 kCT9LO_Cnt9o; Tue, 28 Aug 2018 11:05:36 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 85977595F1; Tue, 28 Aug 2018 11:05:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 35302595F2 for ; Tue, 28 Aug 2018 11:05:34 +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 JUxGoHGIA81Y for ; Tue, 28 Aug 2018 11:05:33 +0200 (CEST) Original-Received: from mail-qt0-f173.google.com (mail-qt0-f173.google.com [209.85.216.173]) (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 20E07595ED for ; Tue, 28 Aug 2018 11:05:23 +0200 (CEST) Original-Received: by mail-qt0-f173.google.com with SMTP id x7-v6so829451qtk.5 for ; Tue, 28 Aug 2018 02:05:23 -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=zs7aaJxl+yzCkZL5HLKRqVV7hZhLGNhg1paNldvVi2U=; b=f8gfX3P0yPZir6hbquTf/Fj4GxAuwPn4HgWzOtTh6u4kSlxRAFqeGKmmw4e1JVS82O tKPZ5/cDuwo0K1bq8Wu6WAMWBZUJCiNCSkQnMHeoTcz/zLfYfDw7fWLZ/YOcXE8l+wfZ BoOpt/jvhkeaKgWyGzUJmOXug8zXttYatflfwiaRUOZB0t/HEh3ysf77LIZhHPiTSb6h psWncm3d8OJ7YiN85zsn0CblOUd5cszM0bsGeglWcO+yNzrwXx6hgFWm5+SoKAUHOj/I dgoOoDfTH+O3iSc0D5yjn5wG2QLlEZEPUEwj31+iU/vEMv+2xCBkpy7cirIFxMg7+ENa cHYQ== 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=zs7aaJxl+yzCkZL5HLKRqVV7hZhLGNhg1paNldvVi2U=; b=t7b3K6lxyoIJC8D2ey8rA8HUN6/5MBm/7JQkAZ3T/cwBcz0TCGat5syEp/kYiQ95SE ZjNPUOsNG1N1fY7/biZJLCd9xrwufxKxy02NeGIMG1JhGIj8lDnIfUIfyl8kXqAAyNvI owfgo4/ec25nsszx4uxRUc7HamvnReNSk3P6xsaTsjoi+WhObeasDzKf5R3cBmWyho+z ZGiLk6+YFuEaXeE0EYwYANaJ1gcES9fCu8J8H4hJyyXUxtccDEFMTZVWC1vucy2qb6Kv BoNgGzsTWVzeus0yR1pUOUbwrFNPN+S/p4cOM7Wg7DaAefzFlPSc/TqTnCacNW85iihe X2iw== X-Gm-Message-State: APzg51BivVvFk529Ss6RkZ/Xx8PE7U6q9kG33rJipmBCbcv0SujPy4gh uXf6ZeUyDWklKJorKVJNGRr41Fb3uQBjXPiPwdMtkg== X-Google-Smtp-Source: ANB0VdYk0N6HTWeMzmXZCPmpJ8y7lk/g0/fajf50Cra0NDAjh1uxjP/TyqLWRLbw/K2jtQYldTTcCkfh06Ru9npSuO8= X-Received: by 2002:a0c:b9a9:: with SMTP id v41-v6mr540274qvf.63.1535447121703; Tue, 28 Aug 2018 02:05:21 -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:101734 Archived-At: --===============7060152248065512707== Content-Type: multipart/alternative; boundary="00000000000042b81505747b2495" --00000000000042b81505747b2495 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 followin= g >> 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 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 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 >> >> ________________________________________________________________________= ___________ > > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ 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 --00000000000042b81505747b2495 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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=C2=A0lun. 27 ao=C3=BBt 2018 =C3=A0=C2=A020:47, Henning Hraban R= amm <texml@fiee.net<= /a>> 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
--00000000000042b81505747b2495-- --===============7060152248065512707== 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 --===============7060152248065512707==--