From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27172 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: placefigure feature request ? Date: Fri, 14 Apr 2006 12:45:45 -0400 Message-ID: References: <443FAD05.5030200@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145033175 29334 80.91.229.2 (14 Apr 2006 16:46:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Apr 2006 16:46:15 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 14 18:46:14 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1FURQm-0004Mx-LD for gctc-ntg-context-518@m.gmane.org; Fri, 14 Apr 2006 18:46:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 484FB12793; Fri, 14 Apr 2006 18:46:00 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26728-01; Fri, 14 Apr 2006 18:45:56 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 689221278D; Fri, 14 Apr 2006 18:45:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 419F41278D for ; Fri, 14 Apr 2006 18:45:55 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26304-04-2 for ; Fri, 14 Apr 2006 18:45:53 +0200 (CEST) Original-Received: from elasmtp-kukur.atl.sa.earthlink.net (elasmtp-kukur.atl.sa.earthlink.net [209.86.89.65]) by ronja.ntg.nl (Postfix) with SMTP id 872001278A for ; Fri, 14 Apr 2006 18:45:53 +0200 (CEST) Original-Received: from [18.54.6.119] (helo=approximate.corpus.cam.ac.uk) by elasmtp-kukur.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1FURQe-0003Zx-H0; Fri, 14 Apr 2006 12:45:52 -0400 Original-Received: from sanjoy by approximate.corpus.cam.ac.uk with local (Exim 4.60) (envelope-from ) id 1FURQX-0007nU-Ny; Fri, 14 Apr 2006 12:45:45 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Fri, 14 Apr 2006 16:09:09 +0200." <443FAD05.5030200@wxs.nl> X-Mailer: MH-E 7.93; nmh 1.1; GNU Emacs 21.4.1 X-ELNK-Trace: dcd19350f30646cc26f3bd1b5f75c9f474bf435c0eb9d4789de090ecffd5a975ad1fe82686a647d79b1e4bc5cddd4d75350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 18.54.6.119 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:27172 Archived-At: > are you sure that you put the code in the right spot? (both float order > patched!) I hadn't thought the location mattered until just now! But I'm not sure where the ideal spot is. Oh, do you mean that I should patch page-flt.tex itself (and rebuild the formats, of course)? It has one \redofloatorder. Instead I had just been inserting your magic in the example source file itself, like so: % first a new key \startconstants dutch english german czech italian romanian french fallback: terugval fallback fallback fallback fallback fallback fallback \stopconstants % use that key \unprotect \long\def\dofloat#1#2#3#4% {\dosetfloatbox{#1}{#2}{#3}{#4}% \doifelsevaluenothing{\??fl#4\c!criterium} {\dogetfloatbox{#1}\empty} {\ifdim\wd\floatbox>\getvalue{\??fl#4\c!criterium}\relax \postcenterfloatbox{\wd\floatbox}% else we get left aligned %dogetfloatbox{#1}\v!here % see details/pascal \dogetfloatbox{#1}{\executeifdefined{\??fl#4\c!fallback}\v!here}% PATCHED \else \dogetfloatbox{#1}\empty \fi}} % pass the new location (will be done differently, hack \def\dogetfloatbox#1#2% {\ifvisible \doifelsenothing{#2} {\getfromcommalist[#1][1]% \@EA\beforesplitstring\commalistelement\at:\to\floatmethod \@EA\aftersplitstring \commalistelement\at:\to\floatcolumn \@EA\aftersplitstring \floatcolumn\at*\to\floatrow \@EA\beforesplitstring\floatcolumn\at*\to\floatcolumn % todo: nog algemeen otr \ifx\OTRSETsetpreferedcolumnslot\undefined\else \OTRSETsetpreferedcolumnslot\floatcolumn\floatrow \fi} {\let\floatcolumn\empty \let\floatrow\empty \edef\floatmethod{#2}}% \doifundefined{\string\floatmethod\floatmethod} {\let\floatmethod\v!here}% \getvalue{\string\floatmethod\floatmethod}[\floatmethod,#1]% PATCHED \fi} \def\dofloatreference {\doifnot\@@bknumbering\v!text {\doglobal\increment\numberedfloat \doifelse\@@bknumbering\v!text % alternative to yes|page {\let\next\immediatewriteutilitycommand} {\let\next\writeutilitycommand}% \expanded{\next {\noexpand\twopassentry {\s!float}% {\numberedfloat}% {\composedsectionnumber}}}}} \def\redofloatorder#1% {\doifnotinset\@@bknumbering{\v!nocheck,\v!text} {\doglobal\increment\nofplacedfloats\relax \gettwopassdata\s!float \iftwopassdatafound \doifnot\composedsectionnumber\twopassdata {\edef\oldcomposedsectionnumber{\composedsectionnumber}% \xdef\composedsectionnumber{\twopassdata}% \showmessage\m!floatblocks1{\nofplacedfloats,#1 \oldcomposedsectionnumber,\composedsectionnumber}}% \fi}} \protect \setupfloats[numbering=text] % we use the marginwidth as criterium \setupfloat[figure][criterium=\marginwidth,fallback=bottom] \starttext \placefigure[bottom]{1}{} \input tufte \placefigure[left]{2}{} \input tufte \placefigure[left]{3}{\framed[width=.9\marginwidth]{}} \input tufte \stoptext