From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101737 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 12:57:59 +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="===============5368370202576542040==" X-Trace: blaine.gmane.org 1535453811 17577 195.159.176.226 (28 Aug 2018 10:56:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 10:56:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 28 12:56:47 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 1fubfy-0004UH-PG for gctc-ntg-context-518@m.gmane.org; Tue, 28 Aug 2018 12:56:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2093A595DA; Tue, 28 Aug 2018 12:58:40 +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 WYPy85sgHFx4; Tue, 28 Aug 2018 12:58:39 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 54C33595DD; Tue, 28 Aug 2018 12:58:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9297B595DD for ; Tue, 28 Aug 2018 12:58:38 +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 ACCoZbbQuCpM for ; Tue, 28 Aug 2018 12:58:37 +0200 (CEST) Original-Received: from mail-qt0-f180.google.com (mail-qt0-f180.google.com [209.85.216.180]) (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 69AC9595DA for ; Tue, 28 Aug 2018 12:58:27 +0200 (CEST) Original-Received: by mail-qt0-f180.google.com with SMTP id z8-v6so1090474qto.9 for ; Tue, 28 Aug 2018 03:58:27 -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=J8C1EO4SiKGvhqZtBpjibcxXvHruHjX5UDLypj6Dok4=; b=poSJ1GCxWhzzZ9X4CXY5Q2Pxjv3CmV3MEyYY9BomyJXdjsehHStFXkstymcnpk+vd0 GiGfaVVtHEOmFzw3I7tX1NrzT3Wq6YTEo8YVNo6McfZxCohI/tge7j3+ul4oCjIBd+cE QN5iBuuwJHH6QPcPsP3D4NspaqjB49twzmBlc6iprRMIPFCqURCovD3Ye+9Mcb+oCQPT 3hUZ4xpaeRgLcnvEZgVY6GkNn1RC/VxCi2nSOZZ3zSS7EW5BukPwLxlHKxxsOMCzvXTV W8DaCgLlPUUJeBhTfErqWjvLRfh45edeJO8/NBeggVwO8LzjFV6TyTMfGneE3FZtuzOj 7htw== 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=J8C1EO4SiKGvhqZtBpjibcxXvHruHjX5UDLypj6Dok4=; b=auyUtK14PsmiSVBo7e60fHjpEBQKLeqVXVJhP8hF3Tejfc+5hfcns3HVku4XVLb9Jr wqqK+pXzuZqi8Oe+9ZXh+Dp0zSUKkqCi5TnZdwgm3s+tQ1PyFi5t0syXnsXK8DNwxMvr szilgSulap1rd+phNTWrIAG2mmIqsWCinQsc8qsY6XpdbSo6sq2H7P5VK0hiyr+KcqWr J/DUltfocQeBVOi815gU4ltYg2ifqfRiVFAlrh9wwaN4gkIueVJBRn+pwFKIQDg25pxQ S1pEE2mXCHet/KIyQ/GosP0s8eXXSm+rE73nHhmAW9LKik9Ht11pP1Ac+FLPZmW0kipO WPlA== X-Gm-Message-State: APzg51D/KKLyoP4RUgLZ3uQbIot7HuMmI3UklSNkCrlzzkBNFI+6fJjh TcdW9mQrDlDOIOPgx+Z4/Wi3Tsq5bd77yvAktS5n5w== X-Google-Smtp-Source: ANB0Vdai44Hy1sYgy89PzKf012jAGrXWBXXOPkIRVXzcqVjTO7Kp9ZKcH2wq9B+lrsJGwap+jt+bLpi1tMjuSaK5IRQ= X-Received: by 2002:aed:2a13:: with SMTP id c19-v6mr924391qtd.147.1535453906086; Tue, 28 Aug 2018 03:58:26 -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:101737 Archived-At: --===============5368370202576542040== Content-Type: multipart/alternative; boundary="000000000000a42e2c05747cb817" --000000000000a42e2c05747cb817 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 28, 2018 at 11:59 AM Fabrice Couvreur < fabrice1.couvreur@gmail.com> wrote: > 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 the= n >>>> 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 >>> 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, everythin= g. >> >> /Mikael >> >> ________________________________________________________________________= ___________ >> 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, there is some misunderstanding. The code from Taco is complete. There are no other files. What we do here is enable/disable parts of the document with modes. We do not insert any other files (I guess one could do that inside the modes if one wants). /Mikael --000000000000a42e2c05747cb817 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Aug 28= , 2018 at 11:59 AM Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
Hi Mikael,
I suppo= se the files test1 and test2 have a special structure ?
=
<= span class=3D"m_-1554307835697415662gmail-">
%%% 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=C2=A0mar. 28 ao=C3=BBt 2018 =C3=A0= =C2=A011:05, Mikael P. Sundqvist <mickep@gmail.com> a =C3=A9crit=C2=A0:
On Tue, Aug 28, 2018 at 10:54 AM Fabrice Couvreur <fabrice1.couvreur= @gmail.com> wrote:
Hi Mikael,
I do not know th= is 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 Ramm <texml@fiee.net> a =C3=A9crit=C2=A0:
Am 2018-08-27 um 16:37 schrieb Mikael P. Sundqvist <= mickep@gmail.com&= gt;:

> > 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
___________________________________________________________________________= ________
___________________________________________________________________________= ________
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,

= there is some misunderstanding. The code from Taco is complete. There are n= o other files. What we do here is enable/disable parts of the document with= modes. We do not insert any other files (I guess one could do that inside = the modes if one wants).

/Mikael=C2=A0
=
--000000000000a42e2c05747cb817-- --===============5368370202576542040== 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 --===============5368370202576542040==--