ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rik Kabel <context@rik.users.panix.com>
To: ntg-context@ntg.nl
Subject: Re: \resetsetups
Date: Thu, 14 Aug 2014 14:23:28 -0400	[thread overview]
Message-ID: <53ECFEA0.2060609@rik.users.panix.com> (raw)
In-Reply-To: <03025B92-D74E-4A40-BF5C-BDC99B4743C6@gmail.com>


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

On 2014-08-14 00:26, Wolfgang Schuster wrote:
>
> Am 13.08.2014 um 20:56 schrieb Rik Kabel <context@rik.users.panix.com 
> <mailto:context@rik.users.panix.com>>:
>
>> Dear list,
>>
>> In a number of notes (recent and in the list archive) I have seen 
>> \resetsetups, used (always) as in a block of code like this from 
>> Gerben Wierde:
>>
>>     \startsetups chapter:before
>>        \page[left]
>>        \noheaderandfooterlines
>>        \startalignment[left,nothyphenated]
>>     	\startnarrower[4*left]
>>     	    \em \getbuffer[chapter:quote]
>>     	\stopnarrower
>>        \stopalignment
>>        \resetsetups[quote:text]
>>        \page[right]
>>        \noheaderandfooterlines
>>        \blank[force,2*big]
>>     \stopsetups
>>
>>
>> What is the purpose of \resetsetups in this code? I see no different 
>> result without it, and all I can determine from list and document 
>> searches is that this is a vestigal command from x-fo processing.
>
> With the \resetsetups command you can remove a previously created 
> setups environment. As you can see from the following example 
> “mysetups” doesn’t exist anymore after the \resetsetups command.
>
> \startsetups[mysetups]
>   Dummy text.
> \stopsetups
>
> \starttext
>
> \doifsetupselse{mysetups}{YES}{NO}
>
> \resetsetups[mysetups]
>
> \doifsetupselse{mysetups}{YES}{NO}
>
> \stoptext
>
> Wolfgang
>
Thank you again, Wolfgang.

I notice that, while the _contents_ of the setup are removed, and using 
the reset setup introduces nothing into the text, there is no error or 
warning generated. (This is also the case, I learned, with an undefined 
buffer.) I can see that this can be very useful in a number of situations.

Can \resetsetups reset more than one setup in a single execution? When I 
try \resetsetups[setupA,setupB] it appears to reset neither. I only ask 
because of the plural name. It does not appear to be a burden to use 
multiple \resetsetups commands.

Are there equivalent commands to \resetsetups and \doifsetupelse for 
buffers? I could find nothing obvious.

The following example shows what I mean by the above statements. My 
examples are often clearer than my descriptions.

    \starttext

    \subject{test 1}

    \startsetups[mysetups]
       YES
    \stopsetups

    1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    \resetsetups[mysetups]

    2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    \startsetups[mysetups]
       yes
    \stopsetups

    3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    \subject{test 2}

    \startsetups[mysetups]
       YES
       \resetsetups[mysetups]
    \stopsetups

    1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    \startsetups[mysetups]
       yes
       \resetsetups[mysetups]
    \stopsetups

    3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

    \subject{test 3}

    \startsetups[mysetups]
       YES
    \stopsetups

    1. ¦\setup[mysetups]¦

       \resetsetups[mysetups]

    2. ¦\setup[mysetups]¦

    \startsetups[mysetups]
       yes
    \stopsetups

    3. ¦\setup[mysetups]¦

    \subject{test 4}

    \startsetups[mysetups]
       YES
       \resetsetups[mysetups]
    \stopsetups

    1. ¦\setup[mysetups]¦

    2. ¦\setup[mysetups]¦

    \startsetups[mysetups]
       yes
       \resetsetups[mysetups]
    \stopsetups

    3. ¦\setup[mysetups]¦

    \subject{test 5}

    1. ¦\setup[neverdefined]¦

    2.  ¦\getbuffer[neverdefined]¦

    \subject{test 6}

    \startsetups[mysetupstwo]
       , SIR!
    \stopsetups

    \startsetups[mysetups]
       YES
    \stopsetups

    1. ¦\setup[mysetups]\setup[mysetupstwo]¦

       \resetsetups[mysetups,mysetupstwo]

    2. ¦\setup[mysetups]\setup[mysetupstwo]¦

    \stoptext

-- 
Rik Kabel

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2014-08-14 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 18:56 \resetsetups Rik Kabel
2014-08-14  4:26 ` \resetsetups Wolfgang Schuster
2014-08-14 18:23   ` Rik Kabel [this message]
2014-08-14 18:35     ` \resetsetups Wolfgang Schuster
2014-08-14 19:06       ` \resetsetups Rik
2014-08-14 19:10         ` \resetsetups Aditya Mahajan
2014-08-14 19:18           ` \resetsetups Rik Kabel
2014-08-14 19:42           ` advanced documents (was: \resetsetups) Peter Münster

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=53ECFEA0.2060609@rik.users.panix.com \
    --to=context@rik.users.panix.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).