ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mikael P. Sundqvist" <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Question on enabling/disabling modes
Date: Tue, 28 Aug 2018 11:04:55 +0200	[thread overview]
Message-ID: <CAHy-LL9Jc1n+_uieymTVGaQZELmUZ7BxHxd=h8k8ZQqWbeRqQA@mail.gmail.com> (raw)
In-Reply-To: <CACyK-eohEPRMF5TA7NYWFBDb5qZdY2PZC-ahCkn2f6sX1R1Q0w@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3308 bytes --]

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ût 2018 à 20:47, Henning Hraban Ramm <texml@fiee.net> a
> écrit :
>
>> 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 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=test1 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’t 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 ‘all’ 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’s 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=test1 file.tex
context --mode=all file.tex

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

/Mikael

[-- Attachment #1.2: Type: text/html, Size: 5674 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2018-08-28  9:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27 12:14 Mikael P. Sundqvist
2018-08-27 13:17 ` Taco Hoekwater
2018-08-27 14:37   ` Mikael P. Sundqvist
2018-08-27 18:46     ` Henning Hraban Ramm
2018-08-28  8:54       ` Fabrice Couvreur
2018-08-28  9:04         ` Mikael P. Sundqvist [this message]
2018-08-28  9:58           ` Fabrice Couvreur
2018-08-28 10:57             ` Mikael P. Sundqvist
2018-08-30 16:55               ` Fabrice Couvreur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHy-LL9Jc1n+_uieymTVGaQZELmUZ7BxHxd=h8k8ZQqWbeRqQA@mail.gmail.com' \
    --to=mickep@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).