From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70408 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: background over two page Date: Wed, 3 Aug 2011 11:08:29 -0400 (EDT) Message-ID: References: <5EC1C613-30AD-448A-8048-455DE97762D8@gmail.com> <6D2C32DB-832A-4038-911B-8E705C558AED@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-413735362-1312384111=:20717" X-Trace: dough.gmane.org 1312384057 25463 80.91.229.12 (3 Aug 2011 15:07:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2011 15:07:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 03 17:07:33 2011 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 1Qod2i-0003rX-7w for gctc-ntg-context-518@m.gmane.org; Wed, 03 Aug 2011 17:07:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 26BB6CAEB7; Wed, 3 Aug 2011 17:07:31 +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 Ce8olvEHGmJ9; Wed, 3 Aug 2011 17:07:28 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 26AC1CAEB2; Wed, 3 Aug 2011 17:07:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EC237CAEB2 for ; Wed, 3 Aug 2011 17:07:26 +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 7KcXSm4fX3SH for ; Wed, 3 Aug 2011 17:07:15 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id B3213CAEB1 for ; Wed, 3 Aug 2011 17:07:15 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p73F7Dvj007187 for ; Wed, 3 Aug 2011 17:07:14 +0200 Original-Received: FROM adi-netbook (bas3-montreal02-1096680814.dsl.bell.ca [65.94.5.110]) By hackers.mr.itd.umich.edu ID 4E396420.2F32B.11234 ; Authuser adityam; 3 Aug 2011 11:07:12 EDT In-Reply-To: <6D2C32DB-832A-4038-911B-8E705C558AED@gmail.com> User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05FfP7de9 - 4b9b5e921423 - 20110803 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 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:70408 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-413735362-1312384111=:20717 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Reviving an old thread because I found a really simple solution. Hopefully= =20 this will also be useful to someone else. On Mon, 18 Oct 2010, Wolfgang Schuster wrote: > > Am 18.10.2010 um 14:18 schrieb Otared Kavian: > >> Your solution works as intended when the framed, highlighted text with b= ackground spans over two pages (though it doesn't when it spans over three = pages or more, but this is not a real issue, since it is a bad idea to have= such long highlighted texts=85). > > > I guess this is also possible with textbackground: > > \newcounter\CurrentBackground > > \def\StartBackground > {\doglobal\increment\CurrentBackground > \setposition{Background:b:\CurrentBackground}% > \startbackground} > > \def\StopBackground > {\stopbackground > \setposition{Background:e:\CurrentBackground}} > > \def\DrawBackground > {\ifnum\MPp{Background:b:\CurrentBackground}=3D\MPp{Background:e:\Curren= tBackground} > \startMPcode > draw topboundary OverlayBox withcolor red ; > draw bottomboundary OverlayBox withcolor red ; > draw leftboundary OverlayBox withcolor red ; > draw rightboundary OverlayBox withcolor red ; > \stopMPcode > \else\ifnum\realpageno=3D\MPp{Background:b:\CurrentBackground} > \startMPcode > draw topboundary OverlayBox withcolor red ; > draw leftboundary OverlayBox withcolor red ; > draw rightboundary OverlayBox withcolor red ; > \stopMPcode > \else\ifnum\realpageno=3D\MPp{Background:e:\CurrentBackground} > \startMPcode > draw bottomboundary OverlayBox withcolor red ; > draw leftboundary OverlayBox withcolor red ; > draw rightboundary OverlayBox withcolor red ; > \stopMPcode > \else > \startMPcode > draw leftboundary OverlayBox withcolor red ; > draw rightboundary OverlayBox withcolor red ; > \stopMPcode > \fi\fi\fi} > > \defineoverlay[DrawBackground][\DrawBackground] > > \setupbackground[background=3DDrawBackground] A much simpler solution using textbackgrounds: \startuseMPgraphic{splitframe} for i=3D1 upto nofmultipars : if one_piece_multi_par : draw multipars[i] ; elseif multilocs[i]=3D1 : draw topboundary multipars[i] ; draw leftboundary multipars[i] ; draw rightboundary multipars[i] ; elseif multilocs[i]=3D2 : draw leftboundary multipars[i] ; draw rightboundary multipars[i] ; elseif multilocs[i]=3D3 : draw leftboundary multipars[i] ; draw rightboundary multipars[i] ; draw bottomboundary multipars[i]; fi ; endfor ; \stopuseMPgraphic \definetextbackground [splitframe] [state=3Dstart, mp=3Dsplitframe, location=3Dparagraph] \starttext \startsplitframe \input knuth \endgraf \stopsplitframe \blank[big] \startsplitframe \dorecurse{4}{\input knuth \endgraf} \stopsplitframe \blank[big] \startsplitframe \dorecurse{10}{\input knuth \endgraf} \stopsplitframe \stoptext Aditya --8323328-413735362-1312384111=:20717 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --8323328-413735362-1312384111=:20717--