From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62707 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: background over two page Date: Mon, 18 Oct 2010 14:18:01 +0200 Message-ID: <5EC1C613-30AD-448A-8048-455DE97762D8@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1287404309 22966 80.91.229.12 (18 Oct 2010 12:18:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Oct 2010 12:18:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 18 14:18:27 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 1P7ofZ-0002Hk-Qe for gctc-ntg-context-518@m.gmane.org; Mon, 18 Oct 2010 14:18:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E3C2DCA775; Mon, 18 Oct 2010 14:18:24 +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 VFRP3W2CdGsr; Mon, 18 Oct 2010 14:18:22 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E12FCCA768; Mon, 18 Oct 2010 14:18:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AA285CA762 for ; Mon, 18 Oct 2010 14:18:19 +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 pRvzkKhdOWdn for ; Mon, 18 Oct 2010 14:18:07 +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 C833DCA760 for ; Mon, 18 Oct 2010 14:18:07 +0200 (CEST) Original-Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9ICI6UY017754 for ; Mon, 18 Oct 2010 14:18:07 +0200 Original-Received: by wwa36 with SMTP id 36so327542wwa.2 for ; Mon, 18 Oct 2010 05:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=Z2X9uNqJQuGOq8r4fAIUjBS9EYD3TOhx1zm6jv/v4qM=; b=SrNvkCp3APNLgRln6eSPeD/DneQhwSO0ONliXYjkDpxizclAFw3+bF4w7ZpHo3GBNI HFEi5IcKG1aNdd5YY5qvNGhvAlpHSxDR5EefjSjwQOB3k4XCEaPEDj88X0ofNbwvOVty Uy66ehcoXAJ/tSV0vt7uWZOJemjhr5+ZbFL6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=RljIctTGCytZiJVIdaaE0A6i9pkfzDpwiZ08gjMDRrCzAFmGCmzYxrpn1NUqezm3+V qPb2ovz7bzELkomld+ibe1aZfSGFHIDVO8Cp14DHu+7ppjdYrjrYZAedhmqfUiYLlU61 tXndcedBWqkisayrQJ8qumf/aDLLkeO/aA2r8= Original-Received: by 10.227.138.147 with SMTP id a19mr4598196wbu.93.1287404285949; Mon, 18 Oct 2010 05:18:05 -0700 (PDT) Original-Received: from mackavian.math.uvsq.fr (MacKavian.math.uvsq.fr [193.51.32.142]) by mx.google.com with ESMTPS id a17sm11563020wbe.12.2010.10.18.05.18.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Oct 2010 05:18:03 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1081) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; 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: 0dDkci60p - 2485582828e3 - 20101018 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:62707 Archived-At: On 18 oct. 2010, at 09:43, luigi scarso wrote: > On Mon, Oct 18, 2010 at 9:32 AM, Otared Kavian wrote: >> [=85] > With my solution it's a matter of changing few lines > bottomframe=3Doff,topframe=3Don, > = > bottomframe=3Don,topframe=3Doff, Thanks Luigi! Your solution works as intended when the framed, highlighted text with back= ground spans over two pages (though it doesn't when it spans over three pag= es or more, but this is not a real issue, since it is a bad idea to have su= ch long highlighted texts=85). Best regards: OK I copy below your modfied solution: % A solution by Luigi Scarso, slightly modified by him %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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, topframe=3Don, % suggested by Luigi, in his answer rulethickness=3D1pt, rightframe=3Don, width=3D\textwidth, leftframe=3Don] \startbackground\unvbox8001\stopbackground% \setupbackground [bottomframe=3Don, topframe=3Doff, % suggested by Luigi, in his answer rulethickness=3D1pt, rightframe=3Don, width=3D\textwidth, leftframe=3Don] \startbackground\unvbox8000\stopbackground% \else \setupbackground [bottomframe=3Don, topframe=3Don, rulethickness=3D1pt, rightframe=3Don, leftframe=3Don] \startbackground #1\stopbackground% \fi \egroup } \setupbackground [bottomframe=3Don, rulethickness=3D1pt, rightframe=3Don, leftframe=3Don] \starttext \input ward \blank \StartBg \dorecurse{2}{\input knuth\par} \StopBg \blank \input ward \blank \StartBg \dorecurse{4}{\input knuth\par} \StopBg \blank \input ward \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% On 18 oct. 2010, at 09:43, luigi scarso wrote: > On Mon, Oct 18, 2010 at 9:32 AM, Otared Kavian wrote: >> = >> On 16 oct. 2010, at 17:30, Emanuele Sacco wrote: >> = >>> A solution by Luigi: >>> [=85] >> = >> Hi Emmanuele, Hi Luigi, >> = >> Please excuse me if I get involved in the thread of your discussions=85 >> I was interested both by the question ad the solutions, since I had a si= milar problem some time ago, but I gave up. >> = >> Now that you give a solution with \definetextbackground (the solution be= low), I would like to point out that with this definition the beginning of = the highlighted text does not have the upper frame turned on, while at the = end the bottom frame is turned on (of course this is what we want). >> So my question is: can one have both the upper frame turned on at the be= gining of the highlighted text (and only there) and also the bottom frame t= urned on at the end (and only there). >> In other words, a highlighted framed text spanning over two (or more) pa= ges, would be like a big rectangle of which the upper and the bottom frame,= as well as the left and right frames, are shown. >> = >> Thanks in advance for you attention: OK > With my solution it's a matter of changing few lines > bottomframe=3Doff,topframe=3Don, > = > = > bottomframe=3Don,topframe=3Doff, > = > = > -- = > 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 : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________