Re: [NTG-context] Text background that spans the width of the page

2014-05-07 Thread Darksair
Hi Hans,

On Tue, May 06, 2014 at 09:29:32PM +0200, Hans Hagen wrote:
 On 5/2/2014 5:59 PM, Darksair wrote:
 Hi all,
 
 I would like to have a colored horizontal stripe as background for one
 line of text.  Sort of like what textbackground does, but I want it to
 span the whole \paperwidth, instead of just \textwidth.  At the end of
 the day, I would use it to style for example my section heads, or to
 highlight one specific \item.  What’s the best way to do it?
 
 you can use textbackgrounds and plug in some mp code that extends into the
 margins ... it depends a bit on what 'line' means here
 
 \startuniqueMPgraphic{whatever}
 fill OverlayBox
 leftenlarged BackSpace
 rightenlarged CutSpace
 withcolor OverlayColor ;
 setbounds currentpicture to OverlayBox
 enlarged max(BackSpace,CutSpace) ;
 \stopuniqueMPgraphic
 
 \defineoverlay[whatever][\uniqueMPgraphic{whatever}]
 
 \framed
   [background=whatever,
backgroundcolor=green,
frame=off,
width=\textwidth]
   {test}%

Thank you for this interesting solution!  I didn’t know one could do
that with Metapost.  This does exactly what I want.

-- 
Darksair
http://darksair.org/
http://twitter.com/#!/MetroWind | http://about.me/darksair
http://www.last.fm/user/Darksair
___
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
___

Re: [NTG-context] Text background that spans the width of the page

2014-05-06 Thread Hans Hagen

On 5/2/2014 5:59 PM, Darksair wrote:

Hi all,

I would like to have a colored horizontal stripe as background for one
line of text.  Sort of like what textbackground does, but I want it to
span the whole \paperwidth, instead of just \textwidth.  At the end of
the day, I would use it to style for example my section heads, or to
highlight one specific \item.  What’s the best way to do it?


you can use textbackgrounds and plug in some mp code that extends into 
the margins ... it depends a bit on what 'line' means here


\startuniqueMPgraphic{whatever}
fill OverlayBox
leftenlarged BackSpace
rightenlarged CutSpace
withcolor OverlayColor ;
setbounds currentpicture to OverlayBox
enlarged max(BackSpace,CutSpace) ;
\stopuniqueMPgraphic

\defineoverlay[whatever][\uniqueMPgraphic{whatever}]

\framed
  [background=whatever,
   backgroundcolor=green,
   frame=off,
   width=\textwidth]
  {test}%

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___

[NTG-context] Text background that spans the width of the page

2014-05-02 Thread Darksair
Hi all,

I would like to have a colored horizontal stripe as background for one
line of text.  Sort of like what textbackground does, but I want it to
span the whole \paperwidth, instead of just \textwidth.  At the end of
the day, I would use it to style for example my section heads, or to
highlight one specific \item.  What’s the best way to do it?

-- 
Fear is the path to the dark side.
Fear leads to anger,
Anger leads to hate,
Hate leads to suffering
___
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
___