From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101733 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 10:54:03 +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="===============5007335479076440087==" X-Trace: blaine.gmane.org 1535446364 10616 195.159.176.226 (28 Aug 2018 08:52:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 08:52:44 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 28 10:52:39 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 1fuZjr-0002gA-RO for gctc-ntg-context-518@m.gmane.org; Tue, 28 Aug 2018 10:52:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F2A7E59507; Tue, 28 Aug 2018 10:54:30 +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 92tm3YDfh7Jc; Tue, 28 Aug 2018 10:54:30 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0CEE95950A; Tue, 28 Aug 2018 10:54:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A535559506 for ; Tue, 28 Aug 2018 10:54:26 +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 gOQcywwotdFW for ; Tue, 28 Aug 2018 10:54:25 +0200 (CEST) Original-Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 61C5659504 for ; Tue, 28 Aug 2018 10:54:15 +0200 (CEST) Original-Received: by mail-wr1-f49.google.com with SMTP id 20-v6so766649wrb.12 for ; Tue, 28 Aug 2018 01:54:15 -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=p7aXvkANwdxySZpZ0/PtR4Wezr1ve4MlgLX7nrJvyiY=; b=OekE6OhFYbiQoRrxsne763Qgu2Yb2pnw4S69vdECOhkUxeQ7UyOplPv2ORGBRO8Wj9 XBNs2SuqY4oyfk5LeLkoXOyWQlBt594O8iVfqVQSJtS3Di3wsltzXjPBmm3HWt5oXYPa XVs60J9wjGpXE46KMPqUH9FD0jBh9nIDOvDpzwVUgFwDBgm/hZIYTQvQGb8Ioh7z6EGo h5K/JshUy4TDyGuxunnvGJsqjA7dod8ak6tQsBbImWnBbMOw+rt7c/CzGn4b88sjukkn RbGYG5/nEP6u07t61TcmwjcmX1z6Pf2sLyf2pRvLEIsXOggnMlsUg3clD7+YyDdwJpiN XDQw== 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=p7aXvkANwdxySZpZ0/PtR4Wezr1ve4MlgLX7nrJvyiY=; b=JU2ezbi/90jLsOTxKyaL2QZAl+slreUVfQrxH6gNzeJmwjDQfM7eW9xf1fZaJ9RKJn R1YBb/PAHT/iHrH2MjR0T3+z/CbXDRJayzHBD5t6XeU/pGOAS0Sw4WnKn9g22iCSHBXc 0x/J/EoeecmB9qQWU2K5QeXnNlAQfm2tG6qf4w+77ncTK+EJH2PVZF1PjB/GcEJvAK33 FxCx5ZnKp+HX5aOsdoDdz7JLSNIkPcZDbiUeDHU0w+q3CxjhG+a9+xmqv+S3XwDF4irj C56rN1qCkYlz7tR/HquOkPxLl5HciZG9dKtYCNQTIHvJX19CFBvMWEUOXReDdj1Q49+r 2Xbg== X-Gm-Message-State: APzg51BP909mMHQkPVtIE9S8yCf7zQ+fnk8pfeqWd+Kx0LC25l9sRQ5L Qb8zu8Y41S+5/FFez4OqX52WDd7+6d6/fbfI4hJaN4AI X-Google-Smtp-Source: ANB0VdZPyEg9BAbsHlYndHd64n6W88LeSNGoIXS9W6MLYA+sQdIkoReQrRszhoGXkTBuBWHZq1dMWh8opdx3NGFYN7A= X-Received: by 2002:a5d:4401:: with SMTP id z1-v6mr463815wrq.227.1535446454834; Tue, 28 Aug 2018 01:54:14 -0700 (PDT) In-Reply-To: <42AF8D50-FCF0-48BC-B870-6C66A71DC463@fiee.net> 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:101733 Archived-At: --===============5007335479076440087== Content-Type: multipart/alternative; boundary="000000000000831b3a05747afc32" --000000000000831b3a05747afc32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 o= nly > 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 ca= ll 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 wel= l > 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 > > _________________________________________________________________________= __________ --000000000000831b3a05747afc32 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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, Henni= ng 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
___________________________________________________________________________= ________
--000000000000831b3a05747afc32-- --===============5007335479076440087== 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 --===============5007335479076440087==--