cormullion wrote:

My last question! :-) I would like to have the various âpartsâ of a book marked with black rectangles at the right side of each page, visible when the reader flips through the pages. I googled successfully to find âfancyhdrâ, but thatâs a LaTeX package, so I donât think it will work in ConTeXt. If itâs not too difficult in ConTeXt, can anyone share the secret?

you may only read this answer if you also put it in the wiki


\unprotected \def\rawsectionnumber#1{\countervalue{\??se#1}} % will be in kernel

\setuppagenumbering
  [alternative=doublesided]

\setupcolors
  [state=start]

\setupbackgrounds
  [page]
  [background=thumbs]

\defineoverlay
  [thumbs]
  [\setups{thumbs}]

\def\NOfChapters{4} % i need to make this one available

\startsetups thumbs

    \definemeasure[thumbheight][\dimexpr\paperheight/\NOfChapters\relax]

    \vbox to \paperheight \bgroup
        \vskip \rawsectionnumber{section-2} \measure{thumbheight}
        \vskip -1                           \measure{thumbheight}
        \doifoddpageelse\hfill\donothing
        \framed
            [background=color,
             backgroundcolor=darkgray,
             frame=off,
             foregroundcolor=white,
             height=\measure{thumbheight},width=1cm]
            {\bfa \rawsectionnumber{section-2}}
        \doifoddpageelse\donothing\hfill
        \vss
    \egroup

\stopsetups

\starttext

\chapter{first}  \dorecurse{10}{\input tufte  }
\chapter{second} \dorecurse{10}{\input davis  }
\chapter{third}  \dorecurse{10}{\input zapf   }
\chapter{fourth} \dorecurse{10}{\input bryson }

\stoptext

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to