Re: [NTG-context] ConTeXt gobble my mind

2014-11-09 Thread Pierre-François Bonnefoi
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.wolfg...@gmail.com wrote:

 
 Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi bonne...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-09 Thread Hans Hagen

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.wolfg...@gmail.com
mailto:schuster.wolfg...@gmail.com wrote:




Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi
bonne...@unilim.fr mailto:bonne...@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 : bonne...@unilim.fr
mailto:bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-08 Thread Wolfgang Schuster

 Am 08.11.2014 um 00:00 schrieb Pierre-François Bonnefoi bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-07 Thread Pierre-François Bonnefoi
Hello Keith and Luigi,


On 06 Nov 2014, at 17:57, Keith J. Schultz keithjschu...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-07 Thread Hans Hagen

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.sca...@gmail.com
mailto:luigi.sca...@gmail.com wrote:




On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François
Bonnefoibonne...@unilim.fr mailto:bonne...@unilim.frwrote:

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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-07 Thread Pierre-François Bonnefoi
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 pra...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-07 Thread Hans Hagen

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 pra...@wxs.nl
mailto:pra...@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 : bonne...@unilim.fr
mailto:bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-07 Thread Pierre-François Bonnefoi
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 pra...@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 pra...@wxs.nl
 mailto:pra...@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 : bonne...@unilim.fr
 mailto:bonne...@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 : bonne...@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
___

[NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Pierre-François Bonnefoi
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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread luigi scarso
On Thu, Nov 6, 2014 at 10:35 AM, Pierre-François Bonnefoi 
bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Wolfgang Schuster

 Am 06.11.2014 um 10:35 schrieb Pierre-François Bonnefoi bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Pierre-François Bonnefoi
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.sca...@gmail.com wrote:

 
 
 On Thu, Nov 6, 2014 at 10:35 AM, Pierre-François Bonnefoi 
 bonne...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread luigi scarso
On Thu, Nov 6, 2014 at 1:36 PM, Pierre-François Bonnefoi bonne...@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
___
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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Pierre-François Bonnefoi
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.wolfg...@gmail.com wrote:

 
 Am 06.11.2014 um 10:35 schrieb Pierre-François Bonnefoi bonne...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Herbert Voss
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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread luigi scarso
On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François Bonnefoi bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Pierre-François Bonnefoi
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.sca...@gmail.com wrote:

 
 
 On Thu, Nov 6, 2014 at 1:59 PM, Pierre-François Bonnefoi bonne...@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 : bonne...@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
___

Re: [NTG-context] ConTeXt gobble my mind

2014-11-06 Thread Keith J. Schultz
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 bonne...@unilim.fr 
 mailto:bonne...@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 : bonne...@unilim.fr 
 mailto:bonne...@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/
 ___
___
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
___