From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27125 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: placefigure feature request ? Date: Wed, 12 Apr 2006 18:12:08 -0400 Message-ID: References: <4432E3BB.7070603@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 1144880074 15049 80.91.229.2 (12 Apr 2006 22:14:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Apr 2006 22:14:34 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 13 00:14:31 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 1FTnb8-0004u9-Dh for gctc-ntg-context-518@m.gmane.org; Thu, 13 Apr 2006 00:14:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 18D991277F; Thu, 13 Apr 2006 00:14:02 +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 28987-05; Thu, 13 Apr 2006 00:14:01 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5110D1278A; Thu, 13 Apr 2006 00:12:17 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D7D981278A for ; Thu, 13 Apr 2006 00:12:15 +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 28971-04-2 for ; Thu, 13 Apr 2006 00:12:14 +0200 (CEST) Original-Received: from elasmtp-mealy.atl.sa.earthlink.net (elasmtp-mealy.atl.sa.earthlink.net [209.86.89.69]) by ronja.ntg.nl (Postfix) with SMTP id C71091277F for ; Thu, 13 Apr 2006 00:12:13 +0200 (CEST) Original-Received: from [128.31.33.106] (helo=approximate.corpus.cam.ac.uk) by elasmtp-mealy.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1FTnZL-0006O2-Pu; Wed, 12 Apr 2006 18:12:12 -0400 Original-Received: from sanjoy by approximate.corpus.cam.ac.uk with local (Exim 4.60) (envelope-from ) id 1FTnZI-00057N-Iz; Wed, 12 Apr 2006 18:12:08 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Tue, 04 Apr 2006 23:23:07 +0200." <4432E3BB.7070603@wxs.nl> X-Mailer: MH-E 7.93; nmh 1.1; GNU Emacs 21.4.1 X-ELNK-Trace: dcd19350f30646cc26f3bd1b5f75c9f474bf435c0eb9d47848d7ba2f7fbb8675f726ac9675167131d7719f847bff240f350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 128.31.33.106 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:27125 Archived-At: > this 'choose between locations' feature is kind of present but only > with 'here' as fallback but it's trivial to make that configurable: I've been experimenting a bit with the code, and it is much appreciated. I added \unprotect..\protect and it compiled fine. The figure numbering is the order in the source files, thanks to the numbering=nocheck; reading down the page it is 3->1->2. Then I felt bold and commented out the numbering=nocheck. It does one clockwise rotation of the numbers: floatblocks : no block given floatblocks : 1 renumbered / figure 1 => 3 (/home/sanjoy/texmf/tex/context/base/pdfr-ec.tex) floatblocks : 1 placed (/home/sanjoy/texmf/tex/context/sample/tufte.tex) floatblocks : no block given floatblocks : 2 renumbered / figure 2 => 1 floatblocks : 2 placed (/home/sanjoy/texmf/tex/context/sample/tufte.tex) floatblocks : 3 renumbered / figure 3 => 2 floatblocks : 3 placed If it had done a anticlockwise rotation, the figure numbers would have been right (1->2->3 reading down the page). Is it because the figure renumbering does not know of the change to fallback=bottom (from fallback=here)? texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005 texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006 tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4) context : ver: 2006.03.25 13:21 cont-en : ver: 2006.03.25 13:21 fmt: 2006.4.11 mes: english Here's the .tex file itself with the above modifications: ====================================================================== % 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} \protect % \setupfloats[numbering=nocheck] % 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 ====================================================================== -Sanjoy `A society of sheep must in time beget a government of wolves.' - Bertrand de Jouvenal