ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: context <ntg-context@ntg.nl>
Subject: Re: How to get the figure size
Date: Tue, 16 Feb 1999 13:53:52 +0100	[thread overview]
Message-ID: <36C96A60.752A1437@wxs.nl> (raw)
In-Reply-To: <000401be5989$d4cdc7c0$0c01a8c1@worf.login-bv.com>

Gilbert van den Dobbelsteen wrote:

> This is probably very trivial but I need to do something like this:
> 
>   \presetexternalfigure[foo][somefig][height=100pt]
>   \framed[width={\figurewidth[foo]}]{Some contents}
> 
> Are there any macro's like this? I need to have the height too.
> I need it because I have a lot of figures with the same height, but with
> different widths.

I'm not sure what you need it for, but the most general way of doing
this kind of things is using tex's box mechanism. Anyhow, this is one
way of doing things: 

(1) Put this somewhere, e.g. on cont-new.tex (I added it to core-fig, so
in th enext release it's there). 

\unprotect

\let\figureheight=\!!zeropoint
\let\figurewidth =\!!zeropoint

\def\getfiguredimensions%
  {\dodoubleempty\dogetfiguredimensions}

\def\dogetfiguredimensions[#1][#2]%
  {{\setbox0=\hbox{\externalfigure[#1][#2,\c!object=\v!nee]}}}

\protect

(2) Now you can ask for the dimensions

\getfiguredimensions[koe.pdf]

width: \figurewidth, height: \figureheight

(3) But, when you just placed the figure, you don't need to ask for it,
because the dimensions are already available in \figurewidth/height (so
you sort of guessed right about this low level secret macro). 

> O yeah, and another problem: I use ActivateState perl, and some DJGPP perl
> (you know, a port that runs under DOS/WIN/OS/2 *and* win95 and it has long
> filename support)
> and there are some differences:
> 
> - The DJGPP port is much faster (and I mean a lot faster here)

The same for tex -).

> - The DJGPP port does globbbing correct, e.g.:
>     texutil --figures --epspage *.eps
>   works fine, while the ActiveState port doesn't (texutil says it doesn't
> know any figures *.eps).

Ha, I just installed active perl and never tested that -)

> Perhaps I did something completely wrong (Ok, Wybo, I'll switch to Linux
> some day). I have to stick to the ActiveState port because I use perl/Tk and
> ODBC database connectivity, which doesn't run under the DJGPP port.

That's why I switched also: Tk (currently I run the perl/tk texedit
version, with tex and metapost support etc).  

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma@wxs.nl

                     ConTeXt and PPCHTeX site: www.ntg.nl/context
-----------------------------------------------------------------


  parent reply	other threads:[~1999-02-16 12:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-16  8:53 Gilbert van den Dobbelsteen
1999-02-16 11:26 ` Taco Hoekwater
1999-02-16 12:55   ` Hans Hagen
1999-02-16 12:53 ` Hans Hagen [this message]
1999-02-16 14:14 ` Taco Hoekwater
1999-02-16 14:18   ` Berend de Boer
1999-02-16 15:28   ` Taco Hoekwater
1999-02-16 14:34     ` Berend de Boer
1999-02-16 15:10     ` Erik Frambach
1999-02-16 17:58       ` Berend de Boer
1999-02-16 19:27 ` W.H. Dekker
1999-02-16 12:10 Berend de Boer
1999-02-16 13:04 ` Hans Hagen
1999-02-16 14:16   ` Berend de Boer

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=36C96A60.752A1437@wxs.nl \
    --to=pragma@wxs.nl \
    --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).