Re: [NTG-context] \externalfigure question

2017-02-17 Thread Hans Hagen

On 2/17/2017 7:06 PM, Alan Braslau wrote:

On Fri, 17 Feb 2017 18:42:25 +0100
Hans Hagen  wrote:


sx=
sy=

iir small scales are also seen as fractions


Like for the chemistry module, this can be confusing.


Also, sx=,sy= muck with the aspect ratio, don't they?

As we know, there is also an inconsistency in the handling of figure
scaling. Consider:

\startMPcode
  draw externalfigure("cow") xsized 5cm ;
  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
  draw rawtextext("\externalfigure[cow][width=5cm]") ;
\stopMPcode

The first will draw a distorted, square 5cmX5cm cow,
The second and third will both draw an undistorted, rectangular
5cmX3.635cm cow.


indeed but that has to do with compatibility ...


or identifying libraries used


which assume different default dpi. Can this be normalized in the case
of file formats (such as pdf) that do not explicitly set the dpi?


luatex teies to figure it out from the tags in th efile ... there has 
been some improvements so maybe older luatex and new ones are different


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread j. van den hoff
On Fri, 17 Feb 2017 19:06:30 +0100, Alan Braslau   
wrote:



or identifying libraries used
which assume different default dpi. Can this be normalized in the case
of file formats (such as pdf) that do not explicitly set the dpi?


if possible I would say this could help "pedestrians" like myself some:  
during document creation and processing I nowhere do see any of that. I  
just get to severly different
pdf documents depending on which machine I compile it (it was a factor of  
2 different figure size in my case (extending well below page limits  
...)). from a user perspective this is of course highly unwelcome (and  
feels a bit like what is happening with MSword to this day, probably ;-))



--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Alan Braslau
On Fri, 17 Feb 2017 18:42:25 +0100
Hans Hagen  wrote:

> sx=
> sy=
> 
> iir small scales are also seen as fractions

Like for the chemistry module, this can be confusing.


Also, sx=,sy= muck with the aspect ratio, don't they?

As we know, there is also an inconsistency in the handling of figure
scaling. Consider:

\startMPcode
  draw externalfigure("cow") xsized 5cm ;
  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
  draw rawtextext("\externalfigure[cow][width=5cm]") ;
\stopMPcode

The first will draw a distorted, square 5cmX5cm cow,
The second and third will both draw an undistorted, rectangular
5cmX3.635cm cow.

> or identifying libraries used

which assume different default dpi. Can this be normalized in the case
of file formats (such as pdf) that do not explicitly set the dpi?

Alan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Hans Hagen

On 2/17/2017 6:05 PM, j. van den hoff wrote:

On Fri, 17 Feb 2017 17:51:11 +0100, Alan Braslau 
wrote:


On Fri, 17 Feb 2017 17:04:27 +0100
"j. van den hoff"  wrote:


On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen  wrote:

>  * if `scale=' is not the way to achieve invariant and unambiguous
> size of images embedded in the document, what is? `width=XXX cm'?
> i.e.: how is this supposed to be done correctly(TM)?
>  just use width=4cm and so

understood, will do (thanks to henning, too, for answering). in any
case, I have settled for `width={fraction}\textwidth' as the most
convenient solution. but if you don't mind explaining: _why_ is
`scale' causing me a problem in the first place? what is the actual
intended (and good) use of this parameter?


scale= is EXTREMELY useful when combining external figures and one
wants to retain uniform linewidths, text pointsizes, etc. Using width=
(or height=) in such a case will lead to very poor results, indeed.


OK, thanks. will try to remember that. -- but in this case
(important/useful parameter...) I am still wondering, why the same value
(say: scale=750) leads to totally different figure size in the pdf
output for two different machines/OSes?

I understand that scale=1000 means "original size" but in want sense? it
seems to dependent on the machine/engine's idea of dpi resolution or
something like that ...


or identifying libraries used


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Hans Hagen

On 2/17/2017 5:51 PM, Alan Braslau wrote:

On Fri, 17 Feb 2017 17:04:27 +0100
"j. van den hoff"  wrote:


On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen  wrote:


 * if `scale=' is not the way to achieve invariant and unambiguous
size of images embedded in the document, what is? `width=XXX cm'?
i.e.: how is this supposed to be done correctly(TM)?
 just use width=4cm and so


understood, will do (thanks to henning, too, for answering). in any
case, I have settled for `width={fraction}\textwidth' as the most
convenient solution. but if you don't mind explaining: _why_ is
`scale' causing me a problem in the first place? what is the actual
intended (and good) use of this parameter?


scale= is EXTREMELY useful when combining external figures and one
wants to retain uniform linewidths, text pointsizes, etc. Using width=
(or height=) in such a case will lead to very poor results, indeed.

Alan

P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
left-over from the previous century - prehistoric days. In the
chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
to confuse things. (Hans: I would suggest dropping this...).


sx=
sy=

iir small scales are also seen as fractions

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread j. van den hoff
On Fri, 17 Feb 2017 17:51:11 +0100, Alan Braslau   
wrote:



On Fri, 17 Feb 2017 17:04:27 +0100
"j. van den hoff"  wrote:


On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen  wrote:

>  * if `scale=' is not the way to achieve invariant and unambiguous
> size of images embedded in the document, what is? `width=XXX cm'?
> i.e.: how is this supposed to be done correctly(TM)?
>  just use width=4cm and so

understood, will do (thanks to henning, too, for answering). in any
case, I have settled for `width={fraction}\textwidth' as the most
convenient solution. but if you don't mind explaining: _why_ is
`scale' causing me a problem in the first place? what is the actual
intended (and good) use of this parameter?


scale= is EXTREMELY useful when combining external figures and one
wants to retain uniform linewidths, text pointsizes, etc. Using width=
(or height=) in such a case will lead to very poor results, indeed.


OK, thanks. will try to remember that. -- but in this case  
(important/useful parameter...) I am still wondering, why the same value  
(say: scale=750) leads to totally different figure size in the pdf output  
for two different machines/OSes?


I understand that scale=1000 means "original size" but in want sense? it  
seems to dependent on the machine/engine's idea of dpi resolution or  
something like that ...


joerg



Alan

P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
left-over from the previous century - prehistoric days. In the
chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
to confuse things. (Hans: I would suggest dropping this...).




--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Alan Braslau
On Fri, 17 Feb 2017 17:04:27 +0100
"j. van den hoff"  wrote:

> On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen  wrote:
> 
> >  * if `scale=' is not the way to achieve invariant and unambiguous
> > size of images embedded in the document, what is? `width=XXX cm'?
> > i.e.: how is this supposed to be done correctly(TM)?
> >  just use width=4cm and so
> 
> understood, will do (thanks to henning, too, for answering). in any
> case, I have settled for `width={fraction}\textwidth' as the most
> convenient solution. but if you don't mind explaining: _why_ is
> `scale' causing me a problem in the first place? what is the actual
> intended (and good) use of this parameter?

scale= is EXTREMELY useful when combining external figures and one
wants to retain uniform linewidths, text pointsizes, etc. Using width=
(or height=) in such a case will lead to very poor results, indeed.

Alan

P.S. Personally, I find that scale=1000 meaning 1 is an unfortunate
left-over from the previous century - prehistoric days. In the
chemistry module rewrite, we take abs(scale)>10 in units of 1000, just
to confuse things. (Hans: I would suggest dropping this...).

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread j. van den hoff

On Fri, 17 Feb 2017 15:43:29 +0100, Hans Hagen  wrote:


 * if `scale=' is not the way to achieve invariant and unambiguous size
of images embedded in the document, what is? `width=XXX cm'? i.e.: how
is this supposed to be done correctly(TM)?
 just use width=4cm and so


understood, will do (thanks to henning, too, for answering). in any case,  
I have settled for `width={fraction}\textwidth' as the most convenient  
solution. but if you don't mind explaining: _why_ is `scale' causing me a  
problem in the first place? what is the actual intended (and good) use of  
this parameter?


..


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Hans Hagen

On 2/17/2017 3:20 PM, j. van den hoff wrote:

I am unsure about the "canonical" way to scale images to the desired
size. my current understanding is, that `scale=' should do what I want
in a way portable across `context' incarnations. so currently I use
commands like

\externalfigure[image.png][scale=750]

to adjust the image size to my taste.

my problem: the same document looks completely different regarding image
size in the produced pdf with standalone installations on osx64 and
linux-64. actually, on oxx64 I have to use something like `scale=1500'
where on linux-64 `scale=750' seemingly does about the same.

questions:

* what am I missing? why does the same document compile differently? I
can only guess that `context' (or luatex?) has two different opinions of
dpi resolution on the two machines when producing the pdf? where can I
control/check this?

* if `scale=' is not the way to achieve invariant and unambiguous size
of images embedded in the document, what is? `width=XXX cm'? i.e.: how
is this supposed to be done correctly(TM)?


just use width=4cm and so

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] \externalfigure question

2017-02-17 Thread Henning Hraban Ramm
Am 2017-02-17 um 15:20 schrieb j. van den hoff :

> I am unsure about the "canonical" way to scale images to the desired size. my 
> current understanding is, that `scale=' should do what I want in a way 
> portable across `context' incarnations. so currently I use commands like
> 
> \externalfigure[image.png][scale=750]
> 
> to adjust the image size to my taste.
> 
> my problem: the same document looks completely different regarding image size 
> in the produced pdf with standalone installations on osx64 and linux-64. 
> actually, on oxx64 I have to use something like `scale=1500' where on 
> linux-64 `scale=750' seemingly does about the same.
> 
> questions:
> 
> * what am I missing? why does the same document compile differently? I can 
> only guess that `context' (or luatex?) has two different opinions of dpi 
> resolution on the two machines when producing the pdf? where can I 
> control/check this?
> 
> * if `scale=' is not the way to achieve invariant and unambiguous size of 
> images embedded in the document, what is? `width=XXX cm'? i.e.: how is this 
> supposed to be done correctly(TM)?

I can’t tell you anything about the difference in calculations, otherwise it 
depends on what you want to achieve: I always use width= or height=, because I 
need specific sizes of my images. Or I define maxwidth=\textwidth. I never had 
a case where the actual scaling would have been important - maps might be a use 
case.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___