From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/16020 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Blank figure hack: is there a better way? Date: Tue, 10 Aug 2004 20:44:22 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <41191786.5090809@wxs.nl> References: <4.3.1.2.20040810103020.00b32668@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1092165420 29940 80.91.224.253 (10 Aug 2004 19:17:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Aug 2004 19:17:00 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 10 21:16:49 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Buc76-0005Vm-00 for ; Tue, 10 Aug 2004 21:16:49 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A98321277F; Tue, 10 Aug 2004 21:16:48 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05591-07; Tue, 10 Aug 2004 21:16:47 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 170AA1277B; Tue, 10 Aug 2004 20:44:28 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 88F301277B for ; Tue, 10 Aug 2004 20:44:26 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05100-03 for ; Tue, 10 Aug 2004 20:44:25 +0200 (CEST) Original-Received: from mailrelay01.solcon.nl (unknown [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id D775E12778 for ; Tue, 10 Aug 2004 20:44:25 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id i7AIiK13013481 for ; Tue, 10 Aug 2004 20:44:20 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 7AFE12EB6E; Tue, 10 Aug 2004 20:44:24 +0200 (CEST) Original-Received: from [10.100.1.191] (unknown [10.100.1.191]) by server-1.pragma-net.nl (Postfix) with ESMTP id 0C55E1A7AB for ; Tue, 10 Aug 2004 18:44:23 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <4.3.1.2.20040810103020.00b32668@cits1.stanford.edu> X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on mailrelay01 X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:16020 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:16020 Brooks Moses wrote: > I'm doing a document which has a large logo in the upper right corner > of the page. The logo (which is on a background layer) intrudes into > the text area by a small amount, and so it would be nice to have the > text wrap around it rather than having to do the wrapping by manual > spacers and line-breaks. > > The "obvious" solution that I came up with for this is to put a blank > right-aligned float at the top of each page (it's a presentation where > all the page breaks are hand-coded, so that's easy to do), of about > the size of the part of the logo that intrudes into the text. I > defined a class of floats just for this: > > \definefloat[logospacer][logospacer] > > (Using the same name for the singular and plural was a hack to get > around the fact that the manual doesn't indicate which of the two the > \setupfloat command uses. Which is it?) > > So far, so good. Except that it's exceptionally hard to _get_ a blank > float in ConTeXt, particularly one of a specified size. > > If I do this (and specify the size in a \setupfloat command): > > \placelogospacer[right, force]{none}{} > > I get a nice float exactly the size I want, but with a frame around it > and the word "undefined" in the middle. > > If I put something in the float -- say, a letter, or a non-breaking > space: > > \placelogospacer[right, force]{none}{~} > > The float suddenly becomes \textwidth wide, which is of course all > wrong, but at least I have a blank float that's not undefined. > > If I put an \hbox in the float, with a fixed width, it stops > stretching to fill the pagewidth, but unless I put something that > actually makes a mark on the page, it still comes up with > "undefined". (The "~" that worked earlier doesn't work if it's in an > \hbox.) I tried a number of tricks -- hiding the nothing in a macro, > using a zero-height rule, and so forth -- and ConTeXt was sufficiently > clever to see through them all. > > There's also the annoyance that I have to specify the size of the > float by the size of the \hbox, rather than in a convenient > [width=...,height=...] fashion. > > Eventually, what I came up with was putting the mark somewhere off the > page, with the following command: > > \placelogospacer[right, force]{none}{\hbox to 1cm{\hskip 5cm x}} > > This of course gives "overfull \hbox" errors, and is a really ugly > hack, but the results are acceptable -- a float of size 1cm by 1 > x-height, which doesn't put marks on the physical page. > > How can I do this better? Better yet, how can I do this properly? the placeholder can be set up quite easily: \starttext \definefloat[logospacer][logospacer] \setupfloat[logospacer][default={right,none},width=1mm,height=1mm,empty=yes] \placelogospacer{}{} \input ward \stoptext As you can see, we also can set the default placement. The 'empty=yes' is not documented (since it is not that old -) An alternative would have been \startsetups placeholder \placefigure[right,none]{}{\framed[width=1mm,height=1mm,frame=off]{}} \stopsteups ..... \setups[placeholder] .... framed boxes without frames are quite handy Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------