[NTG-context] ConTeXt gobble my mind

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Nov 8 12:08:22 CET 2014


> Am 08.11.2014 um 00:00 schrieb Pierre-Fran├žois Bonnefoi <bonnefoi at 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



More information about the ntg-context mailing list