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

2018-02-03 Thread jmmora

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 
greenB")

* 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:

##%%@@HHH&&&
(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 
blue?


Thanks.

---8< - Start example


\usemodule[present-original]
\usemodule[present-common]

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

\defineoverlay
  [PageShape][\useMPgraphic{PageShape}]

\startuseMPgraphic{PageShape}
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 ;
\stopuseMPgraphic

\setupbackgrounds
  [text]
  [background={PageShape}]

\starttext

\setupdocument[title={Title},location={Place}]

\startdocument
  \definecolor[BackgroundColor][r=0,g=.7,b=0]
  \startTopic[title={Topic Green}]
Some text A
\startSubject[title={Some green 1}]
  more text B
\stopSubject
\startSubject[title={Some green 2}]
  more text B
\stopSubject
  \stopTopic

  \definecolor[BackgroundColor][r=0,g=0,b=0.7]
  \startTopic[title={Topic Blue}]
Some text C
\startSubject[title={Some blue}]
  more text D
\stopSubject
  \stopTopic

  \definecolor[BackgroundColor][r=.7,g=0,b=0]
  \startTopic[title={Topic Red}]
Some text E
\startSubject[title={Some Red}]
  more text F
\stopSubject
  \stopTopic
\stopdocument

\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Question about an environment

2018-02-03 Thread Wolfgang Schuster



Fabrice Couvreur 
3. Februar 2018 um 11:20
Hi Wolfgang,
Thank you, we get almost what I want.
With your suggestion, we have this :

1. First
Second
Third

Is it possible to have this :

1. First
Second
Third


Use inline items and add \par (or a empty line) after each line.

\defineenumeration
  [ex]
  [alternative=serried,
   width=2em,
   distance=0pt,
   text=]

\starttext

\startex
\startitemize[text]
\item First \par
\item Second \par
\item Third \par
\stopitemize
\stopex

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Question about an environment

2018-02-03 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you, we get almost what I want.
With your suggestion, we have this :

1. First
Second
Third

Is it possible to have this :

1. First
Second
Third

Thank you.
Fabrice

2018-02-02 18:17 GMT+01:00 Wolfgang Schuster :

>
>
> Fabrice Couvreur 
> 28. Januar 2018 um 22:54
> Hello,
> How to make the first item on the baseline of the numbering as in the
> first exercise ?
>
>
> You have put the item environment in a box.
>
> \defineenumeration
>   [ex]
>   [alternative=serried,
>width=2em,
>distance=0pt,
>text=]
>
> \starttext
>
> \startex
> \dontleavehmode\beginvtop
> % to remove the overfull \hbox message reduce \hsize with
> % the width and distance values of the enumeration
> % \hsize\dimexpr\textwidth-2em\relax
> \startitemize[joinedup]
> \startitem First \stopitem
> \startitem Second \stopitem
> \startitem Third \stopitem
> \stopitemize
> \endvtop
> \stopex
>
> \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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___