ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Christoph Reller <christoph.reller@gmail.com>
To: ntg-context <ntg-context@ntg.nl>
Subject: Re: How does \setupfloat work?
Date: Sat, 29 Nov 2014 20:22:43 +0100	[thread overview]
Message-ID: <CAO8LnPEGd6hW49QuzYHOLoYyypVg3-n4yKaS6e-u0d+3oSk2VQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1718 bytes --]

>
> 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 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

[-- Attachment #1.2: Type: text/html, Size: 2579 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2014-11-29 19:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 19:22 Christoph Reller [this message]
2014-11-29 20:46 ` Mark Szepieniec
2014-11-29 23:48   ` Aditya Mahajan
2014-11-30  0:06     ` Mark Szepieniec
     [not found] <mailman.119.1417258171.2379.ntg-context@ntg.nl>
2014-11-29 12:38 ` Robert Blackstone
  -- strict thread matches above, loose matches on Subject: below --
2014-11-29  9:49 Mark Szepieniec
2014-11-29 10:03 ` Hans Hagen
2014-11-29 10:21   ` Mark Szepieniec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO8LnPEGd6hW49QuzYHOLoYyypVg3-n4yKaS6e-u0d+3oSk2VQ@mail.gmail.com \
    --to=christoph.reller@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).