ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt gobble my mind
@ 2014-11-06  9:35 Pierre-François Bonnefoi
  2014-11-06 11:16 ` luigi scarso
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-06  9:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,

I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :

\starttext
\gobbleuntil\stoptyping
\starttyping
	{ printf("%d", data); }
\stoptyping
This is ignored ! 
\stoptext

How can I use correctly gobbleinput to make it works ?

Thank you for your help,
kind regards,
Pierre-François Bonnefoi. 
-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 6064 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06  9:35 ConTeXt gobble my mind Pierre-François Bonnefoi
@ 2014-11-06 11:16 ` luigi scarso
  2014-11-06 12:36   ` Pierre-François Bonnefoi
  2014-11-06 12:12 ` Wolfgang Schuster
  2014-11-06 16:57 ` Keith J. Schultz
  2 siblings, 1 reply; 19+ messages in thread
From: luigi scarso @ 2014-11-06 11:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Nov 6, 2014 at 10:35 AM, Pierre-François Bonnefoi <
bonnefoi@unilim.fr> wrote:

> Hello,
>
> I've made a lot of improvement to my slides format for my teaching
> material and I've run into a serious issue with gobbleinput that I can
> express with with simple lines :
>
> \starttext
> \gobbleuntil\stoptyping
> \starttyping
> { printf("%d", data); }
> \stoptyping
> This is ignored !
> \stoptext
>
> How can I use correctly gobbleinput to make it works ?
>
>
"%d"
in this situation means ["][ token comment ] <other tokens>
--- \gobbleuntil neutralizes \starttyping that changes the catcode of '%'
 ---
so you are left with an open group  (the { before printf)
that needs to be closed.

So the first step is to make '%' a letter token

\starttext
%\tracingall
\gobbleuntil\stoptyping
\starttyping
    { printf("\%d", data); }
\stoptyping
%\tracingnone
This is not more ignored !
\stoptext



-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1843 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06  9:35 ConTeXt gobble my mind Pierre-François Bonnefoi
  2014-11-06 11:16 ` luigi scarso
@ 2014-11-06 12:12 ` Wolfgang Schuster
  2014-11-06 12:59   ` Pierre-François Bonnefoi
  2014-11-06 16:57 ` Keith J. Schultz
  2 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2014-11-06 12:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 06.11.2014 um 10:35 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
> 
> Hello,
> 
> I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :
> 
> \starttext
> \gobbleuntil\stoptyping
> \starttyping
> 	{ printf("%d", data); }
> \stoptyping
> This is ignored ! 
> \stoptext
> 
> How can I use correctly gobbleinput to make it works ?

Replace the typing environment with normal buffers and use the \typebuffer command to print the content of the buffer.

\starttext

\startbuffer
	{ printf("%d", data); }
\stopbuffer
%\typebuffer
This is ignored ! 

\stoptext

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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 11:16 ` luigi scarso
@ 2014-11-06 12:36   ` Pierre-François Bonnefoi
  2014-11-06 12:46     ` luigi scarso
  2014-11-06 13:00     ` Herbert Voss
  0 siblings, 2 replies; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-06 12:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Luigi,

thank you for proposing a solution, but it's not suitable to my needs as it modifies the content of the typing region : the backlash is displayed

I want to be able to gobble or not the typing region by using a macro without modifying it.



On 06 Nov 2014, at 12:16, luigi scarso <luigi.scarso@gmail.com> wrote:

> 
> 
> On Thu, Nov 6, 2014 at 10:35 AM, Pierre-François Bonnefoi <bonnefoi@unilim.fr> wrote:
> Hello,
> 
> I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :
> 
> \starttext
> \gobbleuntil\stoptyping
> \starttyping
> 	{ printf("%d", data); }
> \stoptyping
> This is ignored ! 
> \stoptext
> 
> How can I use correctly gobbleinput to make it works ?
> 
> 
> "%d" 
> in this situation means ["][ token comment ] <other tokens> 
> --- \gobbleuntil neutralizes \starttyping that changes the catcode of '%'  ---
> so you are left with an open group  (the { before printf)
> that needs to be closed.
> 
> So the first step is to make '%' a letter token
> 
> \starttext
> %\tracingall
> \gobbleuntil\stoptyping
> \starttyping
>     { printf("\%d", data); }
> \stoptyping
> %\tracingnone
> This is not more ignored ! 
> \stoptext
> 
>  
> 
> -- 
> luigi
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 13900 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 12:36   ` Pierre-François Bonnefoi
@ 2014-11-06 12:46     ` luigi scarso
  2014-11-06 13:00     ` Herbert Voss
  1 sibling, 0 replies; 19+ messages in thread
From: luigi scarso @ 2014-11-06 12:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Nov 6, 2014 at 1:36 PM, Pierre-François Bonnefoi <bonnefoi@unilim.fr
> wrote:

> Hello Luigi,
>
> thank you for proposing a solution, but it's not suitable to my needs as
> it modifies the content of the typing region : the backlash is displayed
>
> I know, infact I have said  "the first step is...": \gobbleuntil is quite
lowlevel macro, it assumes that you do some TeX programming.


I want to be able to gobble or not the typing region by using a macro
> without modifying it.
>
>

As Wolfgang says, you can use start/stopbuffer:

\starttext
\startbuffer
\starttyping
    { printf("%d", data); }
\stoptyping
\stopbuffer
This is ignored !
\stoptext

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1597 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 12:12 ` Wolfgang Schuster
@ 2014-11-06 12:59   ` Pierre-François Bonnefoi
  2014-11-06 13:12     ` luigi scarso
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-06 12:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Wolfgang and Luigi,

My example lines are too small to fully understand the purpose of using the gobbleinput instruction :
I have made some slides for my students that I can choose or not ton include in the final presentation :

\skipSlide
\startSlide
	bla bla bla
	\startyping
		language C code
	\stoptyping
	bla bla bla
\stopSlide

I've made some macros to include or not a slide according to its number given into a list or by just putting before the macro \skipSlide.
This is very useful as I have students of different levels.

The gobbleinput solution is the best solution : I can activate or not a slide according to my audience.

If I use the buffer solution, I'll not be able to deactivate the whole slide containing the typing region.

From my understanding, I've used the gobbleinput command as in shell :
cat << EOF
one
two
three
EOF

And now, I've ran into this problem.

On 06 Nov 2014, at 13:12, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

>> 
>> Am 06.11.2014 um 10:35 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
>> 
>> Hello,
>> 
>> I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :
>> 
>> \starttext
>> \gobbleuntil\stoptyping
>> \starttyping
>> 	{ printf("%d", data); }
>> \stoptyping
>> This is ignored ! 
>> \stoptext
>> 
>> How can I use correctly gobbleinput to make it works ?
> 
> Replace the typing environment with normal buffers and use the \typebuffer command to print the content of the buffer.
> 
> \starttext
> 
> \startbuffer
> 	{ printf("%d", data); }
> \stopbuffer
> %\typebuffer
> This is ignored ! 
> 
> \stoptext
> 
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 26036 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 12:36   ` Pierre-François Bonnefoi
  2014-11-06 12:46     ` luigi scarso
@ 2014-11-06 13:00     ` Herbert Voss
  2014-11-06 13:30       ` Pierre-François Bonnefoi
  1 sibling, 1 reply; 19+ messages in thread
From: Herbert Voss @ 2014-11-06 13:00 UTC (permalink / raw)
  To: ntg-context

Am 06.11.2014 um 13:36 schrieb Pierre-François Bonnefoi:

> thank you for proposing a solution, but it's not suitable to my needs as
> it modifies the content of the typing region : the backlash is displayed
> 
> I want to be able to gobble or not the typing region by using a macro
> without modifying it.

\starttext

\iffalse   % or \iftrue
\starttyping
	{ printf("%d", data); }
\stoptyping
\fi
This is not ignored !

\stoptext


Herbert
___________________________________________________________________________________
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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 12:59   ` Pierre-François Bonnefoi
@ 2014-11-06 13:12     ` luigi scarso
  2014-11-06 13:29       ` Pierre-François Bonnefoi
  0 siblings, 1 reply; 19+ messages in thread
From: luigi scarso @ 2014-11-06 13:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François Bonnefoi <bonnefoi@unilim.fr
> wrote:

> Hello Wolfgang and Luigi,
>
> My example lines are too small to fully understand the purpose of using
> the gobbleinput instruction :
> I have made some slides for my students that I can choose or not ton
> include in the final presentation :
>
> \skipSlide
> \startSlide
> bla bla bla
> \startyping
> language C code
> \stoptyping
> bla bla bla
> \stopSlide
>
> I've made some macros to include or not a slide according to its number
> given into a list or by just putting before the macro \skipSlide.
> This is very useful as I have students of different levels.
>
> The gobbleinput solution is the best solution : I can activate or not a
> slide according to my audience.
>
> If I use the buffer solution, I'll not be able to deactivate the whole
> slide containing the typing region.
>
> Perhaps Modes ?
http://wiki.contextgarden.net/Modes



-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1897 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 13:12     ` luigi scarso
@ 2014-11-06 13:29       ` Pierre-François Bonnefoi
  2014-11-07 11:38         ` Hans Hagen
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-06 13:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I can not define a mode for each of my slide neither I can express a list of activated slides.


On 06 Nov 2014, at 14:12, luigi scarso <luigi.scarso@gmail.com> wrote:

> 
> 
> On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François Bonnefoi <bonnefoi@unilim.fr> wrote:
> Hello Wolfgang and Luigi,
> 
> My example lines are too small to fully understand the purpose of using the gobbleinput instruction :
> I have made some slides for my students that I can choose or not ton include in the final presentation :
> 
> \skipSlide
> \startSlide
> 	bla bla bla
> 	\startyping
> 		language C code
> 	\stoptyping
> 	bla bla bla
> \stopSlide
> 
> I've made some macros to include or not a slide according to its number given into a list or by just putting before the macro \skipSlide.
> This is very useful as I have students of different levels.
> 
> The gobbleinput solution is the best solution : I can activate or not a slide according to my audience.
> 
> If I use the buffer solution, I'll not be able to deactivate the whole slide containing the typing region.
> 
> Perhaps Modes ?
> http://wiki.contextgarden.net/Modes
> 
> 
> 
> -- 
> luigi
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 17245 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 13:00     ` Herbert Voss
@ 2014-11-06 13:30       ` Pierre-François Bonnefoi
  0 siblings, 0 replies; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-06 13:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Herbert,

I feared that this one will go wrong with some macro used in my slides.

On 06 Nov 2014, at 14:00, Herbert Voss <Herbert.Voss@FU-Berlin.DE> wrote:

> Am 06.11.2014 um 13:36 schrieb Pierre-François Bonnefoi:
> 
>> thank you for proposing a solution, but it's not suitable to my needs as
>> it modifies the content of the typing region : the backlash is displayed
>> 
>> I want to be able to gobble or not the typing region by using a macro
>> without modifying it.
> 
> \starttext
> 
> \iffalse   % or \iftrue
> \starttyping
> 	{ printf("%d", data); }
> \stoptyping
> \fi
> This is not ignored !
> 
> \stoptext
> 
> 
> Herbert
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 7593 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06  9:35 ConTeXt gobble my mind Pierre-François Bonnefoi
  2014-11-06 11:16 ` luigi scarso
  2014-11-06 12:12 ` Wolfgang Schuster
@ 2014-11-06 16:57 ` Keith J. Schultz
  2014-11-07 10:59   ` Pierre-François Bonnefoi
  2 siblings, 1 reply; 19+ messages in thread
From: Keith J. Schultz @ 2014-11-06 16:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Pierre,

I think you are approaching your problem from the wrong direction!

The way I understand your problem is that you have certain criteria in your slides
when encountered decides whether it should be output or not.

If this is the case then what you have is a classical parsing problem.

That is you start parsing the content of the slide, until you find the criteria
that excludes it or come to the end of the slide.
If you find the criteria then you just continue reading to the end of the slide and not output it,
otherwise send the gathered content to be output.

That would be the most elegant way and can be used for dynamic content.

Now, If you already know if the level is know a head of time the slides can be given a level and you can use
a custom mode that only outputs the slides to this level.

Another way is to build a database or table which is processed from which to choose your slides!

Or define a start/stop command that has a user level parameter and use mode to decide output or not!
this approach should not interfere with other macros you are using.

Hope this helps

regards
	Keith.


> Am 06.11.2014 um 10:35 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr <mailto:bonnefoi@unilim.fr>>:
> 
> Hello,
> 
> I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :
> 
> \starttext
> \gobbleuntil\stoptyping
> \starttyping
> 	{ printf("%d", data); }
> \stoptyping
> This is ignored ! 
> \stoptext
> 
> How can I use correctly gobbleinput to make it works ?
> 
> Thank you for your help,
> kind regards,
> Pierre-François Bonnefoi. 
> -- 
> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr <mailto:bonnefoi@unilim.fr> http://libpfb.so/ <http://libpfb.so/>
> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / http://tex.aanhet.net <http://tex.aanhet.net/>
> archive  : http://foundry.supelec.fr/projects/contextrev/ <http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net <http://contextgarden.net/>
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 8250 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 16:57 ` Keith J. Schultz
@ 2014-11-07 10:59   ` Pierre-François Bonnefoi
  0 siblings, 0 replies; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-07 10:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Keith and Luigi,


On 06 Nov 2014, at 17:57, Keith J. Schultz <keithjschultz@web.de> wrote:

> Hi Pierre,
> 
> I think you are approaching your problem from the wrong direction!
> 
> The way I understand your problem is that you have certain criteria in your slides
> when encountered decides whether it should be output or not.
Yes.
> 
> If this is the case then what you have is a classical parsing problem.
> 
> That is you start parsing the content of the slide, until you find the criteria
> that excludes it or come to the end of the slide.
> If you find the criteria then you just continue reading to the end of the slide and not output it,
> otherwise send the gathered content to be output.
> 
Yes, beautifully expressed.

> That would be the most elegant way and can be used for dynamic content.
> 
Yes, but my current solution brakes on crossing the path of C code : I use \gobbleinput that is defined as (according to some documentation) :
\def\gobbleuntil#1%
  {\long\def\next##1#1{}\next}
As I understand this code, the "goblling" is made as enclosing the text that you dan't want to be added to the output as the body of a function.
If the text contains some restricted characters as the "%", this proposition brakes.
 
> Now, If you already know if the level is know a head of time the slides can be given a level and you can use
> a custom mode that only outputs the slides to this level.
> 
This is what I've made : I express a list of numbered slides and check if each slide has to be outputted or not into the final document.

> Another way is to build a database or table which is processed from which to choose your slides!
> 
This is the path I've followed so far with success for some of my lectures.
But, when I've applied the same process to slides containing C code, this process brakes.

I've tried yesterday evening to modify my slide definition to use the solution provided by Luigi, but I've failed.

> Or define a start/stop command that has a user level parameter and use mode to decide output or not!
> this approach should not interfere with other macros you are using.
> 
How do you make this ?

Please save my remaining hairs on my head !
> Hope this helps
> 
> regards
> 	Keith.
> 
Thank you very much for sparing some time to express so efficiently my problem.

best regards,
Pierre-François.
-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 13124 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-06 13:29       ` Pierre-François Bonnefoi
@ 2014-11-07 11:38         ` Hans Hagen
  2014-11-07 13:26           ` Pierre-François Bonnefoi
  0 siblings, 1 reply; 19+ messages in thread
From: Hans Hagen @ 2014-11-07 11:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/6/2014 2:29 PM, Pierre-François Bonnefoi wrote:
> I can not define a mode for each of my slide neither I can express a
> list of activated slides.
>
>
> On 06 Nov 2014, at 14:12, luigi scarso <luigi.scarso@gmail.com
> <mailto:luigi.scarso@gmail.com>> wrote:
>
>>
>>
>> On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François
>> Bonnefoi<bonnefoi@unilim.fr <mailto:bonnefoi@unilim.fr>>wrote:
>>
>>     Hello Wolfgang and Luigi,
>>
>>     My example lines are too small to fully understand the purpose of
>>     using the gobbleinput instruction :
>>     I have made some slides for my students that I can choose or not
>>     ton include in the final presentation :
>>
>>     \skipSlide
>>     \startSlide
>>     bla bla bla
>>     \startyping
>>     language C code
>>     \stoptyping
>>     bla bla bla
>>     \stopSlide
>>
>>     I've made some macros to include or not a slide according to its
>>     number given into a list or by just putting before the macro
>>     \skipSlide.
>>     This is very useful as I have students of different levels.
>>
>>     The gobbleinput solution is the best solution : I can activate or
>>     not a slide according to my audience.
>>
>>     If I use the buffer solution, I'll not be able to deactivate the
>>     whole slide containing the typing region.
>>
>> Perhaps Modes ?
>> http://wiki.contextgarden.net/Modes

\starttext

\definebuffer[Slide]

foo

% \skipSlide
\startSlide
bla bla bla
\startyping
language C code
\stoptyping
bla bla bla
\stopSlide

bar

\stoptext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-07 11:38         ` Hans Hagen
@ 2014-11-07 13:26           ` Pierre-François Bonnefoi
  2014-11-07 15:17             ` Hans Hagen
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-07 13:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Hans,

thank you for contributing to solve my problem.

I've tried your proposition : how can I get the content of the buffer afterward ?
I've tried \getbuffer[Slide] with no success on MKIV beta that I've just updated.

Does a buffer work only for verbatim content ?

best regards,
Pierre-François.

On 07 Nov 2014, at 12:38, Hans Hagen <pragma@wxs.nl> wrote:

> 
> \starttext
> 
> \definebuffer[Slide]
> 
> foo
> 
> % \skipSlide
> \startSlide
> bla bla bla
> \startyping
> language C code
> \stoptyping
> bla bla bla
> \stopSlide
> 
> bar
> 
> \stoptext
> 
> 

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 6696 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-07 13:26           ` Pierre-François Bonnefoi
@ 2014-11-07 15:17             ` Hans Hagen
  2014-11-07 23:00               ` Pierre-François Bonnefoi
  0 siblings, 1 reply; 19+ messages in thread
From: Hans Hagen @ 2014-11-07 15:17 UTC (permalink / raw)
  To: ntg-context

On 11/7/2014 2:26 PM, Pierre-François Bonnefoi wrote:
> Hello Hans,
>
> thank you for contributing to solve my problem.
>
> I've tried your proposition : how can I get the content of the buffer
> afterward ?
> I've tried \getbuffer[Slide] with no success on MKIV beta that I've just
> updated.

\starttext

\definebuffer[Slide]

foo

\startSlide
bla bla bla
\starttyping
language C code
\stoptyping
bla bla bla
\stopSlide

bar

\getbuffer[\thedefinedbuffer{Slide}]

\getSlide

\stoptext


> Does a buffer work only for verbatim content ?

no, for everything

> best regards,
> Pierre-François.
>
> On 07 Nov 2014, at 12:38, Hans Hagen <pragma@wxs.nl
> <mailto:pragma@wxs.nl>> wrote:
>
>>
>> \starttext
>>
>> \definebuffer[Slide]
>>
>> foo
>>
>> % \skipSlide
>> \startSlide
>> bla bla bla
>> \startyping
>> language C code
>> \stoptyping
>> bla bla bla
>> \stopSlide
>>
>> bar
>>
>> \stoptext
>>
>>
>
> --
> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr
> <mailto:bonnefoi@unilim.fr> http://libpfb.so/
> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-07 15:17             ` Hans Hagen
@ 2014-11-07 23:00               ` Pierre-François Bonnefoi
  2014-11-08 11:08                 ` Wolfgang Schuster
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-07 23:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Just before going to bed, I've found a solution with all your help and the help of Taco Hoekwater through the ntg mail archive :

\def\startSlide%
{\def\stopSlide{\checkSlide\doif{\getvariable{temp}{publish}}{yes}{\page\getbuffer[Slide]}}%
\dostartbuffer[Slide][startSlide][stopSlide]}

Let me know if it's my philosopher's stone...
I've tried it and it works so far.

No more ugly gobbling, my mind is free.

So depressing problem and so simple and elegant solution...

On 07 Nov 2014, at 16:17, Hans Hagen <pragma@wxs.nl> wrote:

> On 11/7/2014 2:26 PM, Pierre-François Bonnefoi wrote:
>> Hello Hans,
>> 
>> thank you for contributing to solve my problem.
>> 
>> I've tried your proposition : how can I get the content of the buffer
>> afterward ?
>> I've tried \getbuffer[Slide] with no success on MKIV beta that I've just
>> updated.
> 
> \starttext
> 
> \definebuffer[Slide]
> 
> foo
> 
> \startSlide
> bla bla bla
> \starttyping
> language C code
> \stoptyping
> bla bla bla
> \stopSlide
> 
> bar
> 
> \getbuffer[\thedefinedbuffer{Slide}]
> 
> \getSlide
> 
> \stoptext
> 
> 
>> Does a buffer work only for verbatim content ?
> 
> no, for everything
> 
>> best regards,
>> Pierre-François.
>> 
>> On 07 Nov 2014, at 12:38, Hans Hagen <pragma@wxs.nl
>> <mailto:pragma@wxs.nl>> wrote:
>> 
>>> 
>>> \starttext
>>> 
>>> \definebuffer[Slide]
>>> 
>>> foo
>>> 
>>> % \skipSlide
>>> \startSlide
>>> bla bla bla
>>> \startyping
>>> language C code
>>> \stoptyping
>>> bla bla bla
>>> \stopSlide
>>> 
>>> bar
>>> 
>>> \stoptext
>>> 
>>> 
>> 
>> --
>> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr
>> <mailto:bonnefoi@unilim.fr> http://libpfb.so/
>> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
>> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
>> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
>> 
>> 
>> 
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>> 
> 
> 
> -- 
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 10929 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-07 23:00               ` Pierre-François Bonnefoi
@ 2014-11-08 11:08                 ` Wolfgang Schuster
  2014-11-09 13:34                   ` Pierre-François Bonnefoi
  0 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2014-11-08 11:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
> 
> Just before going to bed, I've found a solution with all your help and the help of Taco Hoekwater through the ntg mail archive :
> 
> \def\startSlide%
> {\def\stopSlide{\checkSlide\doif{\getvariable{temp}{publish}}{yes}{\page\getbuffer[Slide]}}%
> \dostartbuffer[Slide][startSlide][stopSlide]}
> 
> Let me know if it's my philosopher's stone...
> I've tried it and it works so far.
> 
> No more ugly gobbling, my mind is free.

Below are two other methods.


Method 1
=======

\newconditional\SkipSlide \setfalse\SkipSlide

\definebuffer[Slide]

\def\stopSlide
  {\ifconditional\SkipSlide \else
	 \page \getbuffer[\thedefinedbuffer{Slide}]%
   \fi
   \setfalse\SkipSlide}

\starttext

\startSlide
First Slide
\stopSlide

\settrue\SkipSlide
\startSlide
Second Slide
\stopSlide

\startSlide
Third Slide
\stopSlide

\stoptext


Method 2
=======

\def\startSlide
  {\dosingleempty\dostartSlide}

\def\dostartSlide[#1]%
  {\doifelse{#1}{-}
     {\let\stopSlide\stopSlideNop}
     {\let\stopSlide\stopSlideYes}%
   \grabbufferdata[Slide][startSlide][stopSlide]}

\let\stopSlideNop\relax

\def\stopSlideYes
  {\page
   \getbuffer[Slide]}

\starttext

\startSlide
First Slide
\stopSlide

\startSlide[-]
Second Slide
\stopSlide

\startSlide
Third Slide
\stopSlide

\stoptext


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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-08 11:08                 ` Wolfgang Schuster
@ 2014-11-09 13:34                   ` Pierre-François Bonnefoi
  2014-11-09 14:17                     ` Hans Hagen
  0 siblings, 1 reply; 19+ messages in thread
From: Pierre-François Bonnefoi @ 2014-11-09 13:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Wolfgang,

thank you very much for all these solutions.
Do you have any recommendations about using one over the others ?

Currently, the conditional selection of my slides works pretty good : I have created the following macros :
 \courseSlideList[resavi][1-10,20-30,34,37-40], this macro allows me to activate all the slides given by their number in a list defined in the current file ;
 \includeSelectionFrom{adressage_groupe_utf8}{1-100} this macro allows me to include some slides given by a list of number from an external file ;
 \skipSlide that can suppress the process of the following slide.

Of course, all of theses macros work beautifully recursively with files using them (the numbering macro work nicely on currently defined slides as included slides).

This is why I use only ConTeXt for all my work !

Cheers !
Pierre-François.


On 08 Nov 2014, at 12:08, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> 
>> Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi <bonnefoi@unilim.fr>:
>> 
>> Just before going to bed, I've found a solution with all your help and the help of Taco Hoekwater through the ntg mail archive :
>> 
>> \def\startSlide%
>> {\def\stopSlide{\checkSlide\doif{\getvariable{temp}{publish}}{yes}{\page\getbuffer[Slide]}}%
>> \dostartbuffer[Slide][startSlide][stopSlide]}
>> 
>> Let me know if it's my philosopher's stone...
>> I've tried it and it works so far.
>> 
>> No more ugly gobbling, my mind is free.
> 
> Below are two other methods.
> 
> 
> Method 1
> =======
> 
> \newconditional\SkipSlide \setfalse\SkipSlide
> 
> \definebuffer[Slide]
> 
> \def\stopSlide
>  {\ifconditional\SkipSlide \else
> 	 \page \getbuffer[\thedefinedbuffer{Slide}]%
>   \fi
>   \setfalse\SkipSlide}
> 
> \starttext
> 
> \startSlide
> First Slide
> \stopSlide
> 
> \settrue\SkipSlide
> \startSlide
> Second Slide
> \stopSlide
> 
> \startSlide
> Third Slide
> \stopSlide
> 
> \stoptext
> 
> 
> Method 2
> =======
> 
> \def\startSlide
>  {\dosingleempty\dostartSlide}
> 
> \def\dostartSlide[#1]%
>  {\doifelse{#1}{-}
>     {\let\stopSlide\stopSlideNop}
>     {\let\stopSlide\stopSlideYes}%
>   \grabbufferdata[Slide][startSlide][stopSlide]}
> 
> \let\stopSlideNop\relax
> 
> \def\stopSlideYes
>  {\page
>   \getbuffer[Slide]}
> 
> \starttext
> 
> \startSlide
> First Slide
> \stopSlide
> 
> \startSlide[-]
> Second Slide
> \stopSlide
> 
> \startSlide
> Third Slide
> \stopSlide
> 
> \stoptext
> 
> 
> 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
> ___________________________________________________________________________________

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.


[-- Attachment #1.2: Type: text/html, Size: 9331 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] 19+ messages in thread

* Re: ConTeXt gobble my mind
  2014-11-09 13:34                   ` Pierre-François Bonnefoi
@ 2014-11-09 14:17                     ` Hans Hagen
  0 siblings, 0 replies; 19+ messages in thread
From: Hans Hagen @ 2014-11-09 14:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/9/2014 2:34 PM, Pierre-François Bonnefoi wrote:
> Hello Wolfgang,
>
> thank you very much for all these solutions.
> Do you have any recommendations about using one over the others ?
>
> Currently, the conditional selection of my slides works pretty good : I
> have created the following macros :
>   \courseSlideList[resavi][1-10,20-30,34,37-40], this macro allows me to
> activate all the slides given by their number in a list defined in the
> current file ;
>   \includeSelectionFrom{adressage_groupe_utf8}{1-100} this macro allows
> me to include some slides given by a list of number from an external file ;
>   \skipSlide that can suppress the process of the following slide.
>
> Of course, all of theses macros work beautifully recursively with files
> using them (the numbering macro work nicely on currently defined slides
> as included slides).
>
> This is why I use only ConTeXt for all my work !

there is also a block mechanism, see blocks in test suite ... originally 
that was made for a mix of (parallel) questions, answers, anything 
(numbered and unnumbered), selective filtering by tag etc

Hans

> Cheers !
> Pierre-François.
>
>
> On 08 Nov 2014, at 12:08, Wolfgang Schuster <schuster.wolfgang@gmail.com
> <mailto:schuster.wolfgang@gmail.com>> wrote:
>
>>
>>> Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi
>>> <bonnefoi@unilim.fr <mailto:bonnefoi@unilim.fr>>:
>>>
>>> Just before going to bed, I've found a solution with all your help
>>> and the help of Taco Hoekwater through the ntg mail archive :
>>>
>>> \def\startSlide%
>>> {\def\stopSlide{\checkSlide\doif{\getvariable{temp}{publish}}{yes}{\page\getbuffer[Slide]}}%
>>> \dostartbuffer[Slide][startSlide][stopSlide]}
>>>
>>> Let me know if it's my philosopher's stone...
>>> I've tried it and it works so far.
>>>
>>> No more ugly gobbling, my mind is free.
>>
>> Below are two other methods.
>>
>>
>> Method 1
>> =======
>>
>> \newconditional\SkipSlide \setfalse\SkipSlide
>>
>> \definebuffer[Slide]
>>
>> \def\stopSlide
>>  {\ifconditional\SkipSlide \else
>> \page \getbuffer[\thedefinedbuffer{Slide}]%
>>   \fi
>>   \setfalse\SkipSlide}
>>
>> \starttext
>>
>> \startSlide
>> First Slide
>> \stopSlide
>>
>> \settrue\SkipSlide
>> \startSlide
>> Second Slide
>> \stopSlide
>>
>> \startSlide
>> Third Slide
>> \stopSlide
>>
>> \stoptext
>>
>>
>> Method 2
>> =======
>>
>> \def\startSlide
>>  {\dosingleempty\dostartSlide}
>>
>> \def\dostartSlide[#1]%
>>  {\doifelse{#1}{-}
>>     {\let\stopSlide\stopSlideNop}
>>     {\let\stopSlide\stopSlideYes}%
>>   \grabbufferdata[Slide][startSlide][stopSlide]}
>>
>> \let\stopSlideNop\relax
>>
>> \def\stopSlideYes
>>  {\page
>>   \getbuffer[Slide]}
>>
>> \starttext
>>
>> \startSlide
>> First Slide
>> \stopSlide
>>
>> \startSlide[-]
>> Second Slide
>> \stopSlide
>>
>> \startSlide
>> Third Slide
>> \stopSlide
>>
>> \stoptext
>>
>>
>> Wolfgang
>>
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry
>> to the Wiki!
>>
>> maillist : ntg-context@ntg.nl <mailto: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
>> ___________________________________________________________________________________
>
> --
> Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr
> <mailto:bonnefoi@unilim.fr> http://libpfb.so/
> Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
> 123 av Albert Thomas                    |  Mrs. Peel, we're needed...
> 87060 Limoges CEDEX - FRANCE            |                 The Avengers.
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 19+ messages in thread

end of thread, other threads:[~2014-11-09 14:17 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-06  9:35 ConTeXt gobble my mind Pierre-François Bonnefoi
2014-11-06 11:16 ` luigi scarso
2014-11-06 12:36   ` Pierre-François Bonnefoi
2014-11-06 12:46     ` luigi scarso
2014-11-06 13:00     ` Herbert Voss
2014-11-06 13:30       ` Pierre-François Bonnefoi
2014-11-06 12:12 ` Wolfgang Schuster
2014-11-06 12:59   ` Pierre-François Bonnefoi
2014-11-06 13:12     ` luigi scarso
2014-11-06 13:29       ` Pierre-François Bonnefoi
2014-11-07 11:38         ` Hans Hagen
2014-11-07 13:26           ` Pierre-François Bonnefoi
2014-11-07 15:17             ` Hans Hagen
2014-11-07 23:00               ` Pierre-François Bonnefoi
2014-11-08 11:08                 ` Wolfgang Schuster
2014-11-09 13:34                   ` Pierre-François Bonnefoi
2014-11-09 14:17                     ` Hans Hagen
2014-11-06 16:57 ` Keith J. Schultz
2014-11-07 10:59   ` Pierre-François Bonnefoi

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