Re: [NTG-context] Hairline in header
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 02.03.2011 um 22:12 schrieb Dr. David Endler:
Hi Wolfgang,
Is there also a possibility to have 2 lines below the header with different color and different thickness?
You can use TeX’s own mechanism to draw the rules or use MetaPost. % solution 1: %\startsetups headerrules % \blackrule[width=\hsize,color=yellow,height=3pt] % \blackrule[width=\hsize,color=orange,height=3pt] %\stopsetups % %\setupheader[text][after=\setups{headerrules}] % solution 2: \startuseMPgraphic{headerrules} draw origin--(OverlayWidth,0) withcolor red withpen pencircle scaled 4 ; draw origin--(OverlayWidth,0) withcolor blue withpen pencircle scaled 4 shifted (0,4) ; clip currentpicture to OverlayBox ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[headerrules][\useMPgraphic{headerrules}] \setupbackgrounds[header][text][background=headerrules] \starttext \input knuth \stoptext Wolfgang
![](https://secure.gravatar.com/avatar/6af06dcf5f958fe4ec149408292d6acd.jpg?s=120&d=mm&r=g)
Hi, Of course this is a very elaborate solution which comes in handy, if you want special effects. however for the simple case of a rule you could also use just: \setupbackgrounds[header][text][frame=off, bottomframe=on,rulethickness=1pt] Willi On 3 Mar 2011, at 16:39, Wolfgang Schuster wrote:
Am 02.03.2011 um 22:12 schrieb Dr. David Endler:
Hi Wolfgang,
Is there also a possibility to have 2 lines below the header with different color and different thickness?
You can use TeX’s own mechanism to draw the rules or use MetaPost.
% solution 1:
%\startsetups headerrules % \blackrule[width=\hsize,color=yellow,height=3pt] % \blackrule[width=\hsize,color=orange,height=3pt] %\stopsetups % %\setupheader[text][after=\setups{headerrules}]
% solution 2:
\startuseMPgraphic{headerrules} draw origin--(OverlayWidth,0) withcolor red withpen pencircle scaled 4 ; draw origin--(OverlayWidth,0) withcolor blue withpen pencircle scaled 4 shifted (0,4) ; clip currentpicture to OverlayBox ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic
\defineoverlay[headerrules][\useMPgraphic{headerrules}]
\setupbackgrounds[header][text][background=headerrules]
\starttext \input knuth \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 ___________________________________________________________________________________
participants (2)
-
Willi Egger
-
Wolfgang Schuster