ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* backgrounds
@ 2014-10-15  8:33 Hans Hagen
  2014-10-17 11:32 ` backgrounds Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2014-10-15  8:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,
	
new in next beta

%D Sometimes you have a document wide (page) background but need to 
overload it
%D locally. In such case (at least in my experience) the only values 
that get set
%D are the background and backgroundcolor (if set at all). A full 
inheritance chain
%D would complicate things because then we need to use named backgrounds 
which in
%D turn will make this mechanism slower. I considered independent local 
backgrounds
%D but that also complicates the code (not that much) but isolation 
means that we
%D need to set more parameters each time. The following simple approach 
proabbly
%D suits most usage.

\starttext

     \setupbackgrounds[page][background=color,backgroundcolor=red]
     \input tufte
     \page
     \setupbackgrounds[page][background=,backgroundcolor=]
     \input tufte
     \page
     \setupbackgrounds[page][background=color,backgroundcolor=red]
     \input tufte
     \page
     \pushbackground[page]
         \setupbackgrounds[page][background=color,backgroundcolor=green]
         \input tufte
         \page
     \popbackground
     \input tufte
     \page

\stoptext

(only two parameters pushed/popped)
-- 

-----------------------------------------------------------------
                                           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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 17+ messages in thread
* backgrounds
@ 2004-10-18 10:57 gmorais
  2004-10-18 11:20 ` backgrounds Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: gmorais @ 2004-10-18 10:57 UTC (permalink / raw)


I made this background to the first page of a document:

      \setupcolors[state=start]
      \startuseMPgraphic{page}
	StartPage ;
        pickup pencircle scaled 2pt ;
        fill Field[InnerMargin][Top]     enlarged (0,2.5cm)  
withcolor .625blue ;
      fill Field[InnerMargin][Text]                            withcolor
.6white  ;
      fill Field[InnerMargin][Header]                          withcolor
.625blue ;
      fill Field[Text][Text]           enlarged .5cm           withcolor
white ;
      fill Field[Header][Text]         enlarged (.5cm,0)       withcolor
white ;
      fill Field[Top][Text]            enlarged (.5cm,4cm)     withcolor
white ;

      StopPage ;
      
      \stopuseMPgraphic
      
      \defineoverlay[page][\useMPgraphic{page}]
      \setupbackgrounds[page][background=page]
      

What do I have to do for this background appears only in the first page
(and all the others a simple white page)?

Thanks in advance
gonçalo

^ permalink raw reply	[flat|nested] 17+ messages in thread
* backgrounds
@ 2003-11-03 17:28 Pawel Jackowski na Onet
  2003-11-10 16:49 ` backgrounds Patrick Gundlach
  0 siblings, 1 reply; 17+ messages in thread
From: Pawel Jackowski na Onet @ 2003-11-03 17:28 UTC (permalink / raw)


Hi all!

Could You give me some hint how to setup different backgrounds for even and
odd pages? Lets say I would like to have something like

    \setupbackgrounds[footer][rightmargin][background=screen] % for even
pages and
    \setupbackgrounds[footer][leftmargin][background=screen]  % for odd
pages


Thanks in advance, Pawel

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re[2]: Backgrounds
  2003-04-09 16:57       ` Re[2]: Backgrounds Giuseppe Bilotta
@ 2003-04-10 20:00 Hans Hagen
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Hagen @ 2003-04-10 20:00 UTC (permalink / raw)


At 18:57 09/04/2003 +0200, you wrote:
>Wednesday, April 9, 2003 Patrick Gundlach wrote:
>
>PG> Giuseppe Bilotta <gip.bilotta@iol.it> writes:
>
>PG> Hello Giuseppe,
>
> >> \startuseMPgraphic{mpos:par:columnset}
> >>    path p, q;
> >>    for i := 1 upto nofmultipars :
> >>      p := counterclockwise simplified multipars[i] leftenlarged 5pt
> >>    rightenlarged 5pt ;
>
>PG> why did you use "counterclockwise simplified..." ? What is this?
>
>I used that to make sure that p didn't have extra points
>(simplified) and went in a specific direction (counterclockwise);
>anyway, I rewrote my code:

which can be simplified to:

\startuseMPgraphic{mpos:par:columnset}
    path q ; picture r ; color framecolor, backgroundcolor ;
    cornerradius := 5pt ; offset := 7.5pt ;
    framecolor := red ; framethickness := 2pt ;
    backgroundcolor := lightgray ;
    for i := 1 upto nofmultipars :
      multipars[i] := multipars[i] enlarged offset ;
      if multilocs[i] = 1 : % top
        q := multipars[i] bottomenlarged (4cornerradius) ;
      elseif multilocs[i] = 2 :
        q := multipars[i] bottomenlarged (4cornerradius) ;
        q := q topenlarged (4cornerradius) ;
      else:
        q := multipars[i] topenlarged (4cornerradius) ;
      fi ;
      q := q smoothed (2cornerradius) ;
      r := image
        ( fill q withcolor backgroundcolor ;
          draw q withcolor framecolor
            withpen pencircle scaled framethickness ; ) ;
      clip r to boundingbox multipars[i] ;
      addto currentpicture also r ;
    endfor ;
\stopuseMPgraphic

watch the usage of "enlarged" and the "smoothed"

Hans


>===
>
>\starttext
>
>\setupcolors[state=start]
>
>\definetextbackground[gb][state=start]
>
>\startuseMPgraphic{mpos:par:columnset}
>    pair urc, ulc, llc, lrc ; % corners
>    path urcp, ulcp, llcp, lrcp ; % paths
>    path q ;
>    cornerradius := 5pt ;
>    offset := 7.5pt ;
>    color framecolor, backgroundcolor ;
>    pen framepen ;
>    framecolor := red ;
>    framepen := pensquare rotated 45 ;
>    framethickness := 2pt ;
>    backgroundcolor := lightgray ;
>    for i := 1 upto nofmultipars :
>      urc := urcorner multipars[i] + (offset, offset) ;
>      ulc := ulcorner multipars[i] + (-offset, offset) ;
>      llc := llcorner multipars[i] + (-offset, -offset) ;
>      lrc := lrcorner multipars[i] + (offset, -offset) ;
>      ulcp := quartercircle
>              rotated 90
>              scaled (2*cornerradius)
>              shifted (ulc + (cornerradius, -cornerradius)) ;
>      urcp := quartercircle
>              scaled (2*cornerradius)
>              shifted (urc + (-cornerradius, -cornerradius)) ;
>      llcp := quartercircle
>              rotated 180
>              scaled (2*cornerradius)
>              shifted (llc + (cornerradius, cornerradius)) ;
>      lrcp := quartercircle
>              rotated -90
>              scaled (2*cornerradius)
>              shifted (lrc + (-cornerradius, cornerradius)) ;
>      if multilocs[i] = 1 : % top
>        q := lrc -- urcp -- ulcp -- llc ;
>        fill q--cycle
>             withcolor backgroundcolor ;
>        draw q
>             withcolor framecolor
>             withpen framepen scaled framethickness ;
>      elseif multilocs[i] = 2 :
>        fill llc -- lrc -- urc -- ulc -- cycle
>             withcolor backgroundcolor ;
>        draw ulc -- llc
>             withcolor framecolor
>             withpen framepen scaled framethickness ;
>        draw lrc -- urc
>             withcolor framecolor
>             withpen framepen scaled framethickness ;
>      else:
>        q := ulc -- llcp -- lrcp -- urc ;
>        fill q--cycle
>             withcolor backgroundcolor ;
>        draw q
>             withcolor framecolor
>             withpen framepen scaled framethickness ;
>      fi
>    endfor ;
>\stopuseMPgraphic
>
>\starttextbackground[gb]
>\input tufte
>\stoptextbackground
>
>\blank[2*big]
>
>\starttextbackground[gb]
>\dorecurse{5}{\input tufte \par}
>\stoptextbackground
>\blank \input tufte
>
>\stoptext
>
>===
>
>Now the only thing we need is a way to know when the background is
>split and when it's not. Hans?
>
>--
>Giuseppe "Oblomov" Bilotta
>
>
>
>_______________________________________________
>ntg-context mailing list
>ntg-context@ntg.nl
>http://www.ntg.nl/mailman/listinfo/ntg-context
>
>================================================================
>Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd 
>op virussen.
>Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst 
>waar op wordt gecontroleerd.

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re[2]: Backgrounds
@ 2003-03-25  8:46 Hans Hagen
  2003-03-25 12:25 ` Re[3]: Backgrounds Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2003-03-25  8:46 UTC (permalink / raw)


At 07:52 PM 3/24/2003 +0100, you wrote:

>Actually I did have a look at it (assuming you're talking about
>textbackgrounds), but I found their behaviour to be rather
>different from that of backgrounds even when location=paragraph.
>For example, setting frame=on doesn't give me a frame, and it
>doesn't seem to support rounded corners for neither the background
>nor the frame. Also, setting a largish offset "covers" the text
>that precedes the background, and this isn't nice at all. I think
>that textbackgrounds and backgrounds serve different purpouses.
>
>And what about the other requests? (Behaviour at splits, different
>corner styles)

\starttext

\setupcolors[state=start]

\definetextbackground[gb][state=start]

\startuseMPgraphic{mpos:par:columnset}
   for i := 1 upto nofmultipars :
     fill multipars[i] enlarged 5pt cornered 5pt withcolor green ;
     draw multipars[i] enlarged 5pt cornered 5pt withcolor red ;
   endfor ;
\stopuseMPgraphic

\input tufte \blank
\starttextbackground[gb]
\dorecurse{10}{\input tufte \par}
\stoptextbackground
\blank \input tufte

\stoptext

they split, can have corners, lay behind the text, ...

only some spacing issues need to be solved (working on that on and off)

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Backgrounds
@ 2003-03-24 14:37 Giuseppe Bilotta
  2003-03-24 16:45 ` Backgrounds Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Giuseppe Bilotta @ 2003-03-24 14:37 UTC (permalink / raw)


Hello,

I would like to discuss a few points about backgrounds
(\startbackground ... \stopbackground).

First of all, it would be nice to have "background classes", so
that I can have different backgrounds for different things without
having to reset it each time. (Think
\definebackground[this][options=values], \setupthis, \startthis
... \stopthis, as usual.)

The second point is about the splitting capabilities in
backgrounds. This is incredibly nice to have, but needs a little
finetuning, IMO: it should be possible to specify whether the
various options that concern the "border" of the background (i.e.
background corner, frame, frame corner, etc) should act at split
time or not; example: assume that I set my background to have a
frame (frame=on) If the background gets split across pages, I get
two "boxed" text: the first in the first page, the second in the
second page. Instead, to show that the block continues on the next
page, it should be possible to turn this off. I suggest options
like: splitframe, splitframecorner, splitbackgoundcorner analogous
to topframe/bottomframe and the like, which defines the behaviour
of frames and angles in the "split area".

Moreover (now I'm getting picky, but while we're at it ...) it
would be nice, even for generic framed text, to be able to specify
the behaviour of each single corner separately (say, top left and
top right rounded, bottom left and right rectangular).

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Backgrounds
@ 2000-06-09 10:35 Anders Alstrin
  2000-06-09 16:17 ` Backgrounds Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Anders Alstrin @ 2000-06-09 10:35 UTC (permalink / raw)


Hi all.

I got succes in combining one pdf as background for a existing two sided
pdf.
But now I only want to place a background on the first page and not for
the
second one..
And I can´t figure out from the context manual (page 150) how to do this
on
an existing two sided pdf?

\starttext
\setupoutput[pdftex]

\defineoverlay
  [mall]
  [{\externalfigure[v_mall.pdf]}]

\setupbackgrounds
   [page]
   [background=mall]

\copypages
  [visit1_p.pdf]

\stoptext


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-10-20  8:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15  8:33 backgrounds Hans Hagen
2014-10-17 11:32 ` backgrounds Procházka Lukáš Ing. - Pontex s. r. o.
2014-10-20  1:46   ` backgrounds Hongwen Qiu
2014-10-20  8:17     ` backgrounds Procházka Lukáš Ing. - Pontex s. r. o.
  -- strict thread matches above, loose matches on Subject: below --
2004-10-18 10:57 backgrounds gmorais
2004-10-18 11:20 ` backgrounds Hans Hagen
2003-11-03 17:28 backgrounds Pawel Jackowski na Onet
2003-11-10 16:49 ` backgrounds Patrick Gundlach
2003-04-10 20:00 Re[2]: Backgrounds Hans Hagen
2003-03-25  8:46 Hans Hagen
2003-03-25 12:25 ` Re[3]: Backgrounds Hans Hagen
2003-03-25 14:36   ` Re[4]: Backgrounds Giuseppe Bilotta
2003-04-09 14:52     ` Backgrounds Patrick Gundlach
2003-04-09 16:57       ` Re[2]: Backgrounds Giuseppe Bilotta
2003-04-10  9:50         ` Backgrounds Patrick Gundlach
2003-04-18 14:33           ` Backgrounds Johannes Hüsing
2003-04-19 13:35             ` Backgrounds Patrick Gundlach
2003-04-11 16:02     ` Re[3]: Backgrounds Hans Hagen
2003-04-11 16:21       ` Backgrounds Patrick Gundlach
2003-03-24 14:37 Backgrounds Giuseppe Bilotta
2003-03-24 16:45 ` Backgrounds Hans Hagen
2000-06-09 10:35 Backgrounds Anders Alstrin
2000-06-09 16:17 ` Backgrounds Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).