From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/89348 Path: news.gmane.org!not-for-mail From: Mark Szepieniec Newsgroups: gmane.comp.tex.context Subject: Re: How does \setupfloat work? Date: Sat, 29 Nov 2014 21:46:36 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0768553284==" X-Trace: ger.gmane.org 1417294037 13328 80.91.229.3 (29 Nov 2014 20:47:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 20:47:17 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 29 21:47:12 2014 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 1XuovA-0007ID-M1 for gctc-ntg-context-518@m.gmane.org; Sat, 29 Nov 2014 21:47:12 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2493E1022C for ; Sat, 29 Nov 2014 21:47:12 +0100 (CET) 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 82B6RiDafmU8 for ; Sat, 29 Nov 2014 21:47:11 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4BEAF10235 for ; Sat, 29 Nov 2014 21:46:43 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9D376101FB for ; Sat, 29 Nov 2014 21:46:39 +0100 (CET) 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 1WwEogFOtBgd for ; Sat, 29 Nov 2014 21:46:38 +0100 (CET) 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 75726101E8 for ; Sat, 29 Nov 2014 21:46:38 +0100 (CET) Original-Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id sATKkaID024771 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 29 Nov 2014 21:46:37 +0100 Original-Received: by mail-qc0-f175.google.com with SMTP id b13so6774686qcw.6 for ; Sat, 29 Nov 2014 12:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=2oV7WR0n6ad4dnfrUuTazi9kbZdW9Z/814HL5/mc5A4=; b=OocwnQDdIU/qpFkfM+byoLtD9XcT2B70mC9/IojS/6mAQXZWMIq9a4FcH0tqVN8GC5 lngVvr2teG9UKqKkRDIEm0edy8sPGQDrPNIARAJUXyH1J2lJtZJRtJKMItugk9tC5d+9 EX7oj92Zeo2rW7d0JkYKDViTVUT8LhyTo+nMx8+22/Mh5Ep5Rmuiou19Fr/EkJGt+QZ6 56RN+XR4GM05l7vc56xPnftM67irBxhiZ4otuceHZQeJ6yXQSOn70cvl3+BBXyaF7LDs YxbrBstHKnKLQ6XpadCNzK3FJ4FSehcoKoAsnve+9atDJ6RiHI3Ee+AJAG0dmdl1g0dd OvIQ== X-Received: by 10.229.44.7 with SMTP id y7mr72729889qce.26.1417293996072; Sat, 29 Nov 2014 12:46:36 -0800 (PST) Original-Received: by 10.229.28.193 with HTTP; Sat, 29 Nov 2014 12:46:36 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:400d:c01::22f; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01NlwKBxl - 679b1947681f - 20141129 (trained as not-spam) 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:89348 Archived-At: --===============0768553284== Content-Type: multipart/alternative; boundary=089e0160be822da8880509057913 --089e0160be822da8880509057913 Content-Type: text/plain; charset=UTF-8 On Sat, Nov 29, 2014 at 8:22 PM, Christoph Reller < christoph.reller@gmail.com> wrote: > On Sat, Nov 29, 2014 at 11:03 AM, Hans Hagen wrote: >> >> > On 11/29/2014 10:49 AM, Mark Szepieniec wrote: >> > >> >> I'm trying to set a default width for figures with \setupfloat. >> However, >> >> the command doesn't seem to be picking up the width specification, even >> >> though the manual indicates it accepts a width= argument: >> >> >> >> \setupfloat[figure][width=2cm] >> >> >> >> \starttext >> >> >> >> \placefigure{}{\externalfigure[picture.png]} >> >> >> >> >> >> \stoptext >> >> >> > >> > just >> > >> > \placefigure{}{\externalfigure[picture.png][width=2cm]} >> > >> > >> > >> >> picture.png just gets inserted at its native size, rather than scaled >> to >> >> have the specified width. What am I doing wrong? (setting minwidth >> >> and/or maxwidth doesn't seem to work either) >> >> >> >> Thanks in advance for any assistance. >> >> >> >> Mark >> >> Sorry, I should have mentioned I was able to work around it by doing >> exactly that, but I'd rather not have to edit all the \placefigure >> instances if I decide to change the width. >> >> Also I'd like to use a different default width for graphics, so >> \setupexternalfigures[width=XXXcm] wouldn't work well either. >> >> I realize I could define my own macros or something to solve this, but I'm >> just puzzled that setting width in \setupfloat[figure] doesn't work. Am I >> reading the manual wrong, or is is just not implemented yet or something? >> (honest question) >> >> Thanks for your response, >> >> Mark >> > > Hi Mark, > You can use \defineexternalfigure as in the following example. > > \defineexternalfigure[whatever][width=2cm] > \starttext > \placefigure{}{\externalfigure[picture.png][whatever]} > \stoptext > > See also http://wiki.contextgarden.net/Floating_Objects > > Christoph > > Thanks all for your responses. \defineexternalfigure looks like it does something very close to what I wanted. Googling it brought me to a mailing list thread where a question similar to mine was asked, so for future reference: http://www.ntg.nl/pipermail/ntg-context/2012/069446.html. So I guess my problem is resolved, but I'd still like to understand better why my earlier solution of doing \setupfloat[figure][width=2cm] didn't set a default for later instances of \placefigure. I feel like I might be missing some aspect of the ConTeXt philosophy, or I'm misreading the manual, or it's just a bug...? --089e0160be822da8880509057913 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Sat, Nov 29, 2014 at 8:22 PM, Christoph Reller <= ;christoph.= reller@gmail.com> wrote:
On Sat, Nov 29, 2014 at 11:03 AM, Hans Hagen <pragma@wxs.nl> wrote:

> On 11/29/2014 10:49 AM, Mark Szepieniec wrote:
>
>> I'm trying to set a default width for figures with \setupfloat= . However,
>> the command doesn't seem to be picking up the width specificat= ion, even
>> though the manual indicates it accepts a width=3D argument:
>>
>> \setupfloat[figure][width=3D2cm]
>>
>> \starttext
>>
>> \placefigure{}{\externalfigure[picture.png]}
>>
>>
>> \stoptext
>>
>
> just
>
> \placefigure{}{\externalfigure[picture.png][width=3D2cm]}
>
>
>
>> picture.png just gets inserted at its native size, rather than sca= led to
>> have the specified width. What am I doing wrong? (setting minwidth=
>> and/or maxwidth doesn't seem to work either)
>>
>> Thanks in advance for any assistance.
>>
>> Mark

Sorry, I should have mentioned I was able to work around it by doing
exactly that, but I'd rather not have to edit all the \placefigure
instances if I decide to change the width.

Also I'd like to use a different default width for graphics, so
\setupexternalfigures[width=3DXXXcm] wouldn't work well either.

I realize I could define my own macros or something to solve this, but I= 9;m
just puzzled that setting width in \setupfloat[figure] doesn't work. Am= I
reading the manual wrong, or is is just not implemented yet or something? (honest question)

Thanks for your response,

Mark

Hi Mark,
You can = use \defineexternalfigure as in the following example.

=
\defineexternalfigure[whatever][width=3D2cm]
\sta= rttext
\placefigure{}{\externalfigure[picture.png][whatever]}
\stoptext


Christoph


Thanks all for your responses.

\defineexternalfigure looks like it does something very c= lose to what I wanted. Googling it brought me to a mailing list thread wher= e a question similar to mine was asked, so for future reference: http://www.ntg.n= l/pipermail/ntg-context/2012/069446.html.

So I= guess my problem is resolved, but I'd still like to understand better = why my earlier solution of doing

\setupfloat[figur= e][width=3D2cm]

didn't set a default for later= instances of \placefigure. I feel like I might be missing some aspect of t= he ConTeXt philosophy, or I'm misreading the manual, or it's just a= bug...?
--089e0160be822da8880509057913-- --===============0768553284== 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= --===============0768553284==--