ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to get the figure size
@ 1999-02-16  8:53 Gilbert van den Dobbelsteen
  1999-02-16 11:26 ` Taco Hoekwater
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Gilbert van den Dobbelsteen @ 1999-02-16  8:53 UTC (permalink / raw)


Hi there,

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.

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

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.

Gilbert.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16  8:53 How to get the figure size 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
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Taco Hoekwater @ 1999-02-16 11:26 UTC (permalink / raw)
  Cc: ntg-context

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

    Gilbert> - The DJGPP port is much faster (and I mean a lot faster
    Gilbert> here)

Likely cause: the DJGPP port is compiled with "gcc -03". Speed
optimizations on Windows compilers are usually off because the result
code is too buggy to be usable.  Also, the DJGPP port uses dpmi
memory. Silly, but that is sometimes faster dan "real" windows memory
(no page swapping inside the allocated block).  On the down side: the
rest of your machine will swap much harder. And another: no dll
code. loading dll's is *slow*. And yet another: Windows almost only
calls the scheduler/task switcher on Win32 syscalls, which of course
DJGPP almost never executes...

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

Install bash ;-) The problem is command.com, not perl. It so happens
that DJGPP has a built-in fix and the windows don't. Hans, I thought
we had fixed that with use File::DosGlob etc? 

    Gilbert> Perhaps I did something completely wrong (Ok, Wybo, I'll
    Gilbert> switch to Linux some day). I have to stick to the

Definately helps.

    Gilbert> ActiveState port because I use perl/Tk and ODBC database
    Gilbert> connectivity, which doesn't run under the DJGPP port.

Taco


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16  8:53 How to get the figure size Gilbert van den Dobbelsteen
  1999-02-16 11:26 ` Taco Hoekwater
@ 1999-02-16 12:53 ` Hans Hagen
  1999-02-16 14:14 ` Taco Hoekwater
  1999-02-16 19:27 ` W.H. Dekker
  3 siblings, 0 replies; 14+ messages in thread
From: Hans Hagen @ 1999-02-16 12:53 UTC (permalink / raw)
  Cc: context

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16 11:26 ` Taco Hoekwater
@ 1999-02-16 12:55   ` Hans Hagen
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Hagen @ 1999-02-16 12:55 UTC (permalink / raw)
  Cc: gilbert, ntg-context

Taco Hoekwater wrote:

> Install bash ;-) The problem is command.com, not perl. It so happens
> that DJGPP has a built-in fix and the windows don't. Hans, I thought
> we had fixed that with use File::DosGlob etc?

Add: 

use File::DosGlob ; 

Change: 

sub CheckInputFiles
 { @UserSuppliedFiles = glob @_[0] }

But, does this work ok under Unix? Can you check that? Or should I test
for dos/unix? How etc. I looked into it some time ago but got verrrrrry
frustrated. 

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16  8:53 How to get the figure size Gilbert van den Dobbelsteen
  1999-02-16 11:26 ` Taco Hoekwater
  1999-02-16 12:53 ` Hans Hagen
@ 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 19:27 ` W.H. Dekker
  3 siblings, 2 replies; 14+ messages in thread
From: Taco Hoekwater @ 1999-02-16 14:14 UTC (permalink / raw)
  Cc: gilbert, ntg-context

>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> Taco Hoekwater wrote:
    >> Install bash ;-) The problem is command.com, not perl. It so
    >> happens that DJGPP has a built-in fix and the windows
    >> don't. Hans, I thought we had fixed that with use File::DosGlob
    >> etc?

    Hans> Add:

    Hans> use File::DosGlob ;

    Hans> Change:

    Hans> sub CheckInputFiles { @UserSuppliedFiles = glob @_[0] }

    Hans> But, does this work ok under Unix? Can you check that? Or
    Hans> should I test for dos/unix? How etc. I looked into it some
    Hans> time ago but got verrrrrry frustrated.

It will work OK for all files that do not have * or ? in their name...

Taco


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  1999-02-16 14:14 ` Taco Hoekwater
@ 1999-02-16 14:18   ` Berend de Boer
  1999-02-16 15:28   ` Taco Hoekwater
  1 sibling, 0 replies; 14+ messages in thread
From: Berend de Boer @ 1999-02-16 14:18 UTC (permalink / raw)
  Cc: ntg-context

> It will work OK for all files that do not have * or ? in their name...

I don't have any, do you? :-)

Groetjes,

Berend.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  1999-02-16 15:28   ` Taco Hoekwater
@ 1999-02-16 14:34     ` Berend de Boer
  1999-02-16 15:10     ` Erik Frambach
  1 sibling, 0 replies; 14+ messages in thread
From: Berend de Boer @ 1999-02-16 14:34 UTC (permalink / raw)
  Cc: ntg-context

> Nope, only MsWord users have those: "How are you?.doc" ;-)

Actually, I tried this with Word 97 SR-2, and this filename did not save,
i.e. it stayed in the Save As dialog box.

When I tried to rename a file within Word or Explorer I got:

	A filename cannot contain any of the following characters:
	\/:*?"<>|

We're seeing progress here!

Groetjes,

Berend.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  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
  1 sibling, 1 reply; 14+ messages in thread
From: Erik Frambach @ 1999-02-16 15:10 UTC (permalink / raw)


> Actually, I tried this with Word 97 SR-2, and this filename did not save,
> i.e. it stayed in the Save As dialog box.
> 
> When I tried to rename a file within Word or Explorer I got:
> 
>  A filename cannot contain any of the following characters:
>  \/:*?"<>|
> 
> We're seeing progress here!

Not really. It's been like this since the first incarnation of msdos.
A few changes have occurred though: long file names containing multiple
dots and spaces are now legal (but a bad idea in a TeX environment).

Erik


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  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
  1 sibling, 2 replies; 14+ messages in thread
From: Taco Hoekwater @ 1999-02-16 15:28 UTC (permalink / raw)
  Cc: ntg-context

>>>>> "Berend" == Berend de Boer <berend@pobox.com> writes:

    >> It will work OK for all files that do not have * or ? in their
    >> name...
    Berend> I don't have any, do you? :-)

Nope, only MsWord users have those: "How are you?.doc" ;-)

Greetings, Taco


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  1999-02-16 15:10     ` Erik Frambach
@ 1999-02-16 17:58       ` Berend de Boer
  0 siblings, 0 replies; 14+ messages in thread
From: Berend de Boer @ 1999-02-16 17:58 UTC (permalink / raw)


> Not really. It's been like this since the first incarnation of msdos.
> A few changes have occurred though: long file names
> containing multiple
> dots and spaces are now legal (but a bad idea in a TeX environment).

They have been legal in Unix systems for long. But it is still difficult to
work with such filenames though :-)

Groetjes,

Berend.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16  8:53 How to get the figure size Gilbert van den Dobbelsteen
                   ` (2 preceding siblings ...)
  1999-02-16 14:14 ` Taco Hoekwater
@ 1999-02-16 19:27 ` W.H. Dekker
  3 siblings, 0 replies; 14+ messages in thread
From: W.H. Dekker @ 1999-02-16 19:27 UTC (permalink / raw)


Gilbert wrote:

> Perhaps I did something completely wrong (Ok, Wybo, I'll switch to Linux

You read my mind...

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

-- 
Hartelijke groet, Wybo Dekker
___________________Servalys Analytical Chemistry Services__________________
wybo@servalys.hobby.nl | Deilsedijk 60                 | tel +31-345-652164
www.hobby.nl/~servalys | 4158 CH Deil, The Netherlands | fax +31-345-652383


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: How to get the figure size
  1999-02-16 13:04 ` Hans Hagen
@ 1999-02-16 14:16   ` Berend de Boer
  0 siblings, 0 replies; 14+ messages in thread
From: Berend de Boer @ 1999-02-16 14:16 UTC (permalink / raw)
  Cc: ntg-context

> Yes, but it went wrong somewhere else (forgotten where). But, if IYHO
> you can garantee correct running under unix as well, It will be a
> permanent change. Looks like the file::dosglob is not needed.

This is the only thing that works under Unix. I copied it straight from my
Unix system.

Groetjes,

Berend.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How to get the figure size
  1999-02-16 12:10 Berend de Boer
@ 1999-02-16 13:04 ` Hans Hagen
  1999-02-16 14:16   ` Berend de Boer
  0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 1999-02-16 13:04 UTC (permalink / raw)
  Cc: ntg-context

Berend de Boer wrote:

> This is the correct implementation IMHO. Hopefully in IHHO (In Hans Honest
> Opinion) soon as well :-)

Yes, but it went wrong somewhere else (forgotten where). But, if IYHO
you can garantee correct running under unix as well, It will be a
permanent change. Looks like the file::dosglob is not needed. 

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* How to get the figure size
@ 1999-02-16 12:10 Berend de Boer
  1999-02-16 13:04 ` Hans Hagen
  0 siblings, 1 reply; 14+ messages in thread
From: Berend de Boer @ 1999-02-16 12:10 UTC (permalink / raw)


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

Change routine CheckInputFiles in texutil.pl to:

sub CheckInputFiles
  { my ($UserSuppliedPath) = @_ ;
    @UserSuppliedFiles = glob $UserSuppliedPath }

This is the correct implementation IMHO. Hopefully in IHHO (In Hans Honest
Opinion) soon as well :-)

Groetjes,

Berend. (-:


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1999-02-16 19:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-16  8:53 How to get the figure size 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
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

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