From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92202 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Floating dimensions that adapts automaticall Date: Mon, 3 Aug 2015 20:02:43 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0303918606==" X-Trace: ger.gmane.org 1438625018 27818 80.91.229.3 (3 Aug 2015 18:03:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Aug 2015 18:03:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 03 20:03:22 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZMK51-0002LL-BC for gctc-ntg-context-518@m.gmane.org; Mon, 03 Aug 2015 20:03:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7C28B10255 for ; Mon, 3 Aug 2015 20:03:18 +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 k9f0gk12jCF1 for ; Mon, 3 Aug 2015 20:03:17 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 77E611025B for ; Mon, 3 Aug 2015 20:02:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BA7F41021B for ; Mon, 3 Aug 2015 20:02:47 +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 ILVA0h9P2AW5 for ; Mon, 3 Aug 2015 20:02:46 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id DA6D810215 for ; Mon, 3 Aug 2015 20:02:46 +0200 (CEST) Original-Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) by filter4-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t73I2ivu010609 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 3 Aug 2015 20:02:45 +0200 Original-Received: by iodd187 with SMTP id d187so152130924iod.2 for ; Mon, 03 Aug 2015 11:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=QKuqVvHM0BvluryGlmNJxg347UWrkpy7xIa9eeYNtlQ=; b=Ok6G0PzkO97/1CIWtWDxwtyBL/4hRrzmg0I4JTmio4kHQfO7yPwgJekEh1fkEDr9GD FamKaooyE/AN/vXzb4rfufXELu2v7pPdbzxcPVH0XMC9SqInkWxRbXBJxOsv8SuXM+pU Z3Ou8Is6GcgT1XVlqIfPXkdcF4v2SFTE2397xKcjNzoKJm+Y8PyoEkz+daqTlaazED+T uluLheJEx+f0+4Vo4m2+jhI3Ul9F/RWYR3HMlnSNsZNEtutFJDQI624mshXe0tSbylq6 4anvGFWY1ukwqu/kVjytBC9RrLTjsfMmt4oW4EfUGWim58m66vFQaaL99+yxSf4ebbVI 1fqQ== X-Received: by 10.107.6.231 with SMTP id f100mr20713169ioi.61.1438624963960; Mon, 03 Aug 2015 11:02:43 -0700 (PDT) Original-Received: by 10.64.248.227 with HTTP; Mon, 3 Aug 2015 11:02:43 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c06::235; country=US; region=Iowa; city=Council Bluffs; latitude=41.2619; longitude=-95.8608; http://maps.google.com/maps?q=41.2619,-95.8608&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01P0i2JNn - a6f23e068a54 - 20150803 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c06::235 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2607:f8b0:4001:c06::235; envelope-from=; helo=mail-io0-x235.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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 Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:92202 Archived-At: --===============0303918606== Content-Type: multipart/alternative; boundary=001a113f9be4f1281f051c6bf922 --001a113f9be4f1281f051c6bf922 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, In the code below, we can see that the table overflows. Of course, one can play on the table dimensions to adjust its position. However it is possible to define a floating whose dimensions automatically adapt to the available space ? Thank you, Fabrice \definefloat [MyFloat] [figure] \setupfloat [MyFloat] [default=3D{right,none}] \startsetups[table:initialize] \setupTABLE[start][align=3D{middle,lohi},width=3D2cm,offset=3D1ex] \setupTABLE[column][first][width=3D4cm] \setupTABLE[row][first][background=3Dcolor,backgroundcolor=3Dlightgray] \stopsetups \showframe \starttext \placeMyFloat{}{\externalfigure[louvre.jpg][width=3D5cm]} Le tableau ci-dessous indique le nombre d'entr=C3=A9es (en milliers) au mus= =C3=A9e du Louvre : \blank[medium] \startmidaligned \placeMyFloat{}{ \bTABLE[setups=3Dtable:initialize] \bTR \bTH \eTH \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTH \eTH \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \eTR \eTABLE \stopmidaligned} \blank[medium] \stoptext --001a113f9be4f1281f051c6bf922 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
In the code below, we can see that the table overflows.
Of course, one can play
on = the table dimensions = to adjust its position.
However= it is possible to define a floating whose dimensions automatic= ally adapt to the ava= ilable space ?
Thank you,
Fabrice


\definefloat
=C2=A0=C2=A0 [MyFloat]<= br>=C2=A0=C2=A0 [figure]

\setupfloat
=C2=A0=C2=A0 [MyFloat]
= =C2=A0=C2=A0 [default=3D{right,none}]

\startsetups[table:initialize]=
=C2=A0 \setupTABLE[start][align=3D{middle,lohi},width=3D2cm,offset=3D1e= x]
=C2=A0 \setupTABLE[column][first][width=3D4cm]
=C2=A0 \setupTABLE[= row][first][background=3Dcolor,backgroundcolor=3Dlightgray]
\stopsetups<= br>
\showframe

\starttext
\placeMyFloat{}{\externalfigure[louv= re.jpg][width=3D5cm]}
Le tableau ci-dessous indique le nombre d'entr= =C3=A9es (en milliers) au mus=C3=A9e du Louvre :
\blank[medium]
\star= tmidaligned
\placeMyFloat{}{
\bTABLE[setups=3Dtable:initialize]
\b= TR
=C2=A0=C2=A0=C2=A0 \bTH=C2=A0 \eTH
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 \= eTD
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 \eTD
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 = \eTD
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 \eTD
\eTR
\bTR
=C2=A0=C2=A0= =C2=A0 \bTH=C2=A0 \eTH
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 \eTD
=C2=A0=C2= =A0=C2=A0 \bTD=C2=A0 \eTD
=C2=A0=C2=A0=C2=A0 \bTD=C2=A0 \eTD
=C2=A0= =C2=A0=C2=A0 \bTD=C2=A0 \eTD
\eTR
\eTABLE
\stopmidaligned}
\bla= nk[medium]
\stoptext

--001a113f9be4f1281f051c6bf922-- --===============0303918606== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0303918606==--