From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27247 Path: news.gmane.org!not-for-mail From: Johannes Graumann Newsgroups: gmane.comp.tex.context Subject: Re: Figure caption on different page? Date: Tue, 18 Apr 2006 21:53:02 -0700 Organization: Die Guten Message-ID: References: <443E381E.1010105@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 1145422756 27484 80.91.229.2 (19 Apr 2006 04:59:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2006 04:59:16 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 19 06:59: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 1FW4mU-000530-JH for gctc-ntg-context-518@m.gmane.org; Wed, 19 Apr 2006 06:59:10 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8E6ED1279A; Wed, 19 Apr 2006 06:59:09 +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 32125-03; Wed, 19 Apr 2006 06:59:04 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AA7011277C; Wed, 19 Apr 2006 06:59:04 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 944251277C for ; Wed, 19 Apr 2006 06:59: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 31957-07 for ; Wed, 19 Apr 2006 06:59:01 +0200 (CEST) Original-Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by ronja.ntg.nl (Postfix) with SMTP id 8714812775 for ; Wed, 19 Apr 2006 06:59:01 +0200 (CEST) Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FW4mG-00050W-Gk for ntg-context@ntg.nl; Wed, 19 Apr 2006 06:58:56 +0200 Original-Received: from iluvatar.caltech.edu ([131.215.35.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Apr 2006 06:58:56 +0200 Original-Received: from johannes_graumann by iluvatar.caltech.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Apr 2006 06:58:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ntg-context@ntg.nl Original-Lines: 47 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: iluvatar.caltech.edu User-Agent: KNode/0.10.2 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:27247 Archived-At: Hans Hagen wrote: > > ... > Thank you. I have modified that code and it does what I want (see below). There is however one generalization issue: the line '\externalfigure[\XMLflush{graphic}][width=\textwidth]' should really be able to use scaling to '\textwidth' or \'textheight' depending on what fills the page better without overflowing it. Is there any way I can make ConTeXt check which one is better: 'width=\textwidth' or height='\textheight'? Thanks, Joh \definefloat[caption] \setupfloat[caption][location=right] \defineframedtext [captiontext] [width=\textwidth,style={{\smallbodyfont}\setupinterlinespace[line=2.8ex]},frame=off,topframe=on] \defineXMLenvironment [fpfigure] { \bgroup \defineXMLsave[caption] \defineXMLsave[graphic] } { \placefigure [page,none] [\XMLpar{figure}{label}{}] {} {\externalfigure[\XMLflush{graphic}][width=\textwidth]} \placecaption [bottom,none] {} {\startcaptiontext \placefloatcaption [figure] {\XMLflush{caption}} \stopcaptiontext} \egroup }