ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \resetsetups
@ 2014-08-13 18:56 Rik Kabel
  2014-08-14  4:26 ` \resetsetups Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Rik Kabel @ 2014-08-13 18:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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.

-- 
Rik

[-- Attachment #1.2: Type: text/html, Size: 967 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-13 18:56 \resetsetups Rik Kabel
@ 2014-08-14  4:26 ` Wolfgang Schuster
  2014-08-14 18:23   ` \resetsetups Rik Kabel
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2014-08-14  4:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 13.08.2014 um 20:56 schrieb Rik Kabel <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


[-- Attachment #1.2: Type: text/html, Size: 1959 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-14  4:26 ` \resetsetups Wolfgang Schuster
@ 2014-08-14 18:23   ` Rik Kabel
  2014-08-14 18:35     ` \resetsetups Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Rik Kabel @ 2014-08-14 18:23 UTC (permalink / raw)
  To: ntg-context


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-14 18:23   ` \resetsetups Rik Kabel
@ 2014-08-14 18:35     ` Wolfgang Schuster
  2014-08-14 19:06       ` \resetsetups Rik
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2014-08-14 18:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.08.2014 um 20:23 schrieb Rik Kabel <context@rik.users.panix.com>:

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

No, you can only reset a single environment with the command.

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

\resetbuffer[<name>] and \doifelsebuffer{<name>}{…}{…}

Wolfgang

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-14 18:35     ` \resetsetups Wolfgang Schuster
@ 2014-08-14 19:06       ` Rik
  2014-08-14 19:10         ` \resetsetups Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Rik @ 2014-08-14 19:06 UTC (permalink / raw)
  To: ntg-context

On 2014-08-14 14:35, Wolfgang Schuster wrote:
> Am 14.08.2014 um 20:23 schrieb Rik Kabel <context@rik.users.panix.com>:
>
>> 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.
> No, you can only reset a single environment with the command.
>
>> Are there equivalent commands to \resetsetups and \doifsetupelse for buffers? I could find nothing obvious.
> \resetbuffer[<name>] and \doifelsebuffer{<name>}{…}{…}
>
> Wolfgang
Thank you again.

I was looking for \doifbufferelse and \resetbuffers as analogous to the 
setups commands. While such consistency is nice, it is rare to find.

While I appreciate learning about these from the list, I must echo 
recent comments about the state of documentation. If these are user 
commands, as these appear to be, one should be able to find them in at 
least the advanced documents.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-14 19:06       ` \resetsetups Rik
@ 2014-08-14 19:10         ` Aditya Mahajan
  2014-08-14 19:18           ` \resetsetups Rik Kabel
  2014-08-14 19:42           ` advanced documents (was: \resetsetups) Peter Münster
  0 siblings, 2 replies; 8+ messages in thread
From: Aditya Mahajan @ 2014-08-14 19:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 14 Aug 2014, Rik wrote:

> While I appreciate learning about these from the list, I must echo recent 
> comments about the state of documentation. If these are user commands, as 
> these appear to be, one should be able to find them in at least the advanced 
> documents.

Please add the relavant information to the wiki, and then one will be able 
to find them in the advanced documents :-)

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: \resetsetups
  2014-08-14 19:10         ` \resetsetups Aditya Mahajan
@ 2014-08-14 19:18           ` Rik Kabel
  2014-08-14 19:42           ` advanced documents (was: \resetsetups) Peter Münster
  1 sibling, 0 replies; 8+ messages in thread
From: Rik Kabel @ 2014-08-14 19:18 UTC (permalink / raw)
  To: ntg-context

On 2014-08-14 15:10, Aditya Mahajan wrote:
> On Thu, 14 Aug 2014, Rik wrote:
>
>> While I appreciate learning about these from the list, I must echo 
>> recent comments about the state of documentation. If these are user 
>> commands, as these appear to be, one should be able to find them in 
>> at least the advanced documents.
>
> Please add the relavant information to the wiki, and then one will be 
> able to find them in the advanced documents :-)
>
> Aditya

When I understand a command enough to wikify it, or note an issue that 
might be problematic for somebody else, I have done just that. I do not 
know the syntax of these commands enough to do that now, and cannot be 
sure from the code just what it is.

Providing incomplete or inaccurate documentation does not benefit anyone.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* advanced documents (was:  \resetsetups)
  2014-08-14 19:10         ` \resetsetups Aditya Mahajan
  2014-08-14 19:18           ` \resetsetups Rik Kabel
@ 2014-08-14 19:42           ` Peter Münster
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Münster @ 2014-08-14 19:42 UTC (permalink / raw)
  To: ntg-context

On Thu, Aug 14 2014, Aditya Mahajan wrote:

> Please add the relavant information to the wiki, and then one will be able to
> find them in the advanced documents :-)

You can also send patches for the ConTeXt Manual:
https://foundry.supelec.fr/svn/contextman/context-reference/

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-14 19:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 18:56 \resetsetups Rik Kabel
2014-08-14  4:26 ` \resetsetups Wolfgang Schuster
2014-08-14 18:23   ` \resetsetups Rik Kabel
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

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).