[NTG-context] Presentation sections identified by color and mark

jmmora at us.es jmmora at us.es
Sat Feb 3 22:02:52 CET 2018

Hi, I'm starting a presentation with ConTeXt.

I'd like to visually differentiate each section, so I've come up with 
two complementary approaches to do that:

* Use a different color palette for each section, and
* Mark the progress bar to indicate the start of each section.

I've done an small example (at the end) but:

* Last Subject of a Topic take color from next Topic. (e.g. "Some 
* I don't like interactionBar styles provided.

I'd like something like:

(horizontal line and a vertical line at the begin of each section and a 
vertical line of different color for current position)

other option I like:

(each letter represents a color. It's a bar with colors marking size of 
text. So it's a series of color rectangles with colors for each section 
and a vertical line for current position)

The main problems are:

* How can I pass the first page of each section to MetaPost?
* How can I protect background color of SomeGreenB to be green and not 


-------8< ----- Start example


\definecolor [PageColor]       [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor]   [r=.75]
\definecolor [PositionColor]   [s=.55]


     StartPage ;
         path p ; pair pa, pb ; numeric len ; color contrastcolor ;
         numeric i;
         numeric sections[];
         % simulated load of sections
         sections[0] := 1;
         sections[1] := 4;
         sections[2] := 6;

         pickup pencircle scaled 5pt ;
         p := (100pt,100pt)--(500pt,100pt);
         draw p withcolor \MPcolor{OrnamentColor} ;
         contrastcolor = \MPcolor{PositionColor} ;
         if (RealPageNumber > 0) and (NOfPages > 0):
             len := 1/NOfPages ;
             i := 0;
             forever :
               exitunless known sections[i];

               pa := point(0+len*sections[i]) of p ;
               draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor 
\MPcolor{OrnamentColor} ;
               i := i + 1;
             endfor ;
             pa := point (0+len*RealPageNumber) of p ;
             %draw (pa+(0,10pt))--(pa+(0,-10pt)) withcolor contrastcolor 
             draw pa withpen pencircle scaled 10pt withcolor 
contrastcolor ;
        fi ;
     StopPage ;




   \startTopic[title={Topic Green}]
     Some text A
     \startSubject[title={Some green 1}]
       more text B
     \startSubject[title={Some green 2}]
       more text B

   \startTopic[title={Topic Blue}]
     Some text C
     \startSubject[title={Some blue}]
       more text D

   \startTopic[title={Topic Red}]
     Some text E
     \startSubject[title={Some Red}]
       more text F


More information about the ntg-context mailing list