From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62669 Path: news.gmane.org!not-for-mail From: Emanuele Sacco Newsgroups: gmane.comp.tex.context Subject: Re: background over two page Date: Sat, 16 Oct 2010 17:30:08 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1287243031 21783 80.91.229.12 (16 Oct 2010 15:30:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Oct 2010 15:30:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 16 17:30:29 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P78iK-0004Un-OY for gctc-ntg-context-518@m.gmane.org; Sat, 16 Oct 2010 17:30:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 25ECDCA752; Sat, 16 Oct 2010 17:30:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HrXRC4obnO0U; Sat, 16 Oct 2010 17:30:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 45604CA743; Sat, 16 Oct 2010 17:30:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8E450CA743 for ; Sat, 16 Oct 2010 17:30:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mgQnA2vRHcwc for ; Sat, 16 Oct 2010 17:30:11 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 23277CA73E for ; Sat, 16 Oct 2010 17:30:11 +0200 (CEST) Original-Received: from mail-yw0-f41.google.com (mail-yw0-f41.google.com [209.85.213.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9GFU9Ak028637 for ; Sat, 16 Oct 2010 17:30:09 +0200 Original-Received: by ywh1 with SMTP id 1so1014651ywh.14 for ; Sat, 16 Oct 2010 08:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=viCnKQyvH926g9cKJ+iIuv8EQ6saSPutFIgZ1YwWwVU=; b=L3qjMvhbkN5pPI9Xu1Wa8qq4dhdwXAuevrPJp/NoYuFiJCHSg1oKhOYz2jjovoka5f 7xd14wtcUROuTQ+A8T8kNVwQByfE4qeptlyy+IhZyl+Wv+v8+54e4WiPEcd1YLWlIrre wbTCiX26WZZrLC+pdgxQpxP7j8lW6exaQXKxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Kf/ItM0TWyuDPKBtsl7bBvgIGzq3mEA+uvNW6FHxjGLAVV191DKYyyemHQlpf8LaxA 4payPZTyxVxFo5mYZbMFvcgDlonswO6Tz4Jys5Si/0gf46GSffexmPXt7IIOobdsnqmH 0VppgfGrpkjTNbvBc1Svlxp5+jNwyV9InZJxY= Original-Received: by 10.42.180.196 with SMTP id bv4mr1580449icb.85.1287243008353; Sat, 16 Oct 2010 08:30:08 -0700 (PDT) Original-Received: by 10.231.173.17 with HTTP; Sat, 16 Oct 2010 08:30:08 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.213.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dDjru9JC - 41f2189ad397 - 20101016 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62669 Archived-At: A solution by Luigi: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newdimen\SpaceLeft \def\CheckSpace{% \ifdim\pagetotal=3D0pt\SpaceLeft=3D\vsize\else\SpaceLeft=3D\pagegoal\advanc= e\SpaceLeft by -\pagetotal\advance\SpaceLeft by -2\lineheight\fi}% \setupcolors[state=3Dstart] \long\def\StartBg#1\StopBg{% \bgroup \setbox8000=3D\vbox{\hsize=3D\dimexpr\textwidth-1em\relax#1} \CheckSpace% \the\SpaceLeft\the\ht8000 \the\dp8000 \ifdim\dimexpr(\ht8000+\dp8000)>\SpaceLeft\relax % \setbox8001=3D\vsplit8000 to \SpaceLeft% \setbox8001=3D\vbox{\unvbox8001}% % \setupbackground [bottomframe=3Doff, rulethickness=3D1pt, rightframe=3Don,width=3D\textwidth, leftframe=3Don] \startbackground\unvbox8001\stopbackground% \setupbackground [bottomframe=3Don, rulethickness=3D1pt, rightframe=3Don,width=3D\textwidth, leftframe=3Don] \startbackground\unvbox8000\stopbackground% \else \setupbackground [bottomframe=3Don, rulethickness=3D1pt, rightframe=3Don, leftframe=3Don] \startbackground #1\stopbackground% \fi \egroup } \setupbackground [bottomframe=3Don, rulethickness=3D1pt, rightframe=3Don, leftframe=3Don] \starttext \startbackground \input knuth \stopbackground e poi \StartBg \input knuth \input knuth \input knuth \StopBg \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% An alternative solution with the command \definetextbackground: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setupcolors[state=3Dstart] \enableregime[utf] \def\Linea{\startMPcode draw (0,0) -- (\the\textwidth-1,0) withpen pencircle scaled 1bp withcolor = red; \stopMPcode } \definetextbackground [Prova] [ mp=3Dbackground:mp, location=3Dparagraph, rulethickness=3D1pt, width=3Dbroad, leftoffset=3D1em, rightoffset=3D1em, after=3D{\Linea} ] \startuseMPgraphic{background:mp} path p; for i =3D 1 upto nofmultipars : p =3D (multipars[i] topenlarged 5pt bottomenlarged 10pt); fill p withcolor lightgray ; draw leftboundary p withpen pencircle scaled 1bp withcolor red ; draw rightboundary p withpen pencircle scaled 1bp withcolor red ; endfor; \stopuseMPgraphic \starttext \startProva \input knuth \input knuth \input knuth \input knuth \input knuth \stopProva \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bye ES 2010/10/14 luigi scarso : > On Thu, Oct 14, 2010 at 11:05 AM, Emanuele Sacco > wrote: >> Hi all, >> >> I'm using context MkII. >> My code is >> >> >> \setupcolors[state=3Dstart] >> \setupbackground >> [bottomframe=3Don, >> rulethickness=3D1pt, >> rightframe=3Don, >> leftframe=3Don] >> >> \starttext >> Good: >> \startbackground >> \input knuth >> \stopbackground >> >> Not good: >> >> \startbackground >> \input knuth >> \input knuth >> \input knuth >> \stopbackground >> \stoptext >> >> >> >> The second backgrounded text is on two pages. Is there a way to not >> show the bottomframe at the end of the first page? >> thanks >> >> ES >> -- >> Al mondo ci sono 10 tipi di persone: quelli che conoscono il sistema >> binario e quelli che non lo conoscono. >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o the Wiki! >> >> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-c= ontext >> webpage =A0: http://www.pragma-ade.nl / http://tex.aanhet.net >> archive =A0: http://foundry.supelec.fr/projects/contextrev/ >> wiki =A0 =A0 : http://contextgarden.net >> ________________________________________________________________________= ___________ >> > > As always =A0my pov: a wrapper macro. > > \showframe > \newdimen\SpaceLeft > \def\CheckSpace{% > \ifdim\pagetotal=3D0pt\SpaceLeft=3D\vsize\else\SpaceLeft=3D\pagegoal\adva= nce\SpaceLeft > =A0by -\pagetotal\advance\SpaceLeft by -2\lineheight\fi}% > > > \setupcolors[state=3Dstart] > > > \long\def\StartBg#1\StopBg{% > \bgroup > \setbox8000=3D\vbox{#1} > \CheckSpace% \the\SpaceLeft\the\ht8000 \the\dp8000 > \ifdim\dimexpr(\ht8000+\dp8000)>\SpaceLeft\relax > % > \setbox8001=3D\vsplit8000 to \SpaceLeft% > \setbox8001=3D\vbox{\unvbox8001}% > % > \setupbackground > [bottomframe=3Doff, > rulethickness=3D1pt, > rightframe=3Don, > leftframe=3Don] > \startbackground\unvbox8001\stopbackground% > > \setupbackground > [bottomframe=3Don, > rulethickness=3D1pt, > rightframe=3Don, > leftframe=3Don] > \startbackground\unvbox8000\stopbackground% > \else > \setupbackground > [bottomframe=3Don, > rulethickness=3D1pt, > rightframe=3Don, > leftframe=3Don] > \startbackground #1\stopbackground% > \fi > \egroup > } > > \setupbackground > [bottomframe=3Don, > rulethickness=3D1pt, > rightframe=3Don, > leftframe=3Don] > > \starttext > Good: > \startbackground > \input knuth > \stopbackground > > Not good: > > \StartBg > \input knuth > \input knuth > \input knuth > \StopBg > > \stoptext > > > > -- > luigi > _________________________________________________________________________= __________ > 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-co= ntext > webpage =A0: http://www.pragma-ade.nl / http://tex.aanhet.net > archive =A0: http://foundry.supelec.fr/projects/contextrev/ > wiki =A0 =A0 : http://contextgarden.net > _________________________________________________________________________= __________ > -- = Al mondo ci sono 10 tipi di persone: quelli che conoscono il sistema binario e quelli che non lo conoscono. ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________