Discussion:
missing l3box counterparts of graphics' \resizebox variants
Alexander Grahn
2014-06-27 12:51:02 UTC
Permalink
Hello,

some of the possible `\resizebox` usages don't map to corresponding
l3box functions.

In particular, I am looking for

\resizebox{<h-size>}{<v-size>}

and

\resizebox{!}{<v-size>}

The first one resizes width and height of the original box to the provided
<h-size> and <v-size> values and the second one only the height, while
maintaining the original aspect ratio of the box content.

The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.

There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.

Could they be provided in a future l3box version?

Thanks and kind regards,
Alexander
Will Robertson
2014-06-28 04:25:58 UTC
Permalink
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,

I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.

Cheers,
Will
Alexander Grahn
2014-06-28 13:04:57 UTC
Permalink
Post by Will Robertson
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,
I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.
Thanks, Will.

The direct l3 counterpart of

\resizebox{<h-size>}{<v-size>}

is missing too, since

\box_resize:Nnn<box>{<h-size>}{<v-size>} is

actually

\resizebox*{<h-size>}{<v-size>}

that is, after resizing, the box' totalheight is set to <v-scale>,
thus, something like \box_resize_to_wd_and_ht:Nnn to set width and
height.

Regards,
Alexander.
Post by Will Robertson
Cheers,
Will
--
Dr.-Ing. Alexander Grahn
Helmholtz-Zentrum Dresden-Rossendorf e. V.,
Institut für Ressourcenökologie
PF 51 01 19
01314 Dresden
Allemagne

m a i l t o : A . G r a h n @ h z d r . d e
Tel.: +49 (0)3 51-2 60 23 31
Fax.: +49 (0)3 51-2 60 12 33 1

Vorstand: Prof. Dr. Dr. h. c. Roland Sauerbrey, Prof. Dr. Dr. h. c. Peter
Joehnk
Vereinsregister: VR 1693 beim Amtsgericht Dresden
Joseph Wright
2014-07-03 07:25:59 UTC
Permalink
Post by Alexander Grahn
Post by Will Robertson
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,
I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.
Thanks, Will.
The direct l3 counterpart of
\resizebox{<h-size>}{<v-size>}
is missing too, since
\box_resize:Nnn<box>{<h-size>}{<v-size>} is
actually
\resizebox*{<h-size>}{<v-size>}
that is, after resizing, the box' totalheight is set to <v-scale>,
thus, something like \box_resize_to_wd_and_ht:Nnn to set width and
height.
Regards,
Alexander.
If we are having one here we should have the other: I'll add.
--
Joseph Wright
Alexander Grahn
2014-07-03 07:47:23 UTC
Permalink
Hi Joseph,
Post by Joseph Wright
Post by Alexander Grahn
Post by Will Robertson
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,
I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.
Thanks, Will.
The direct l3 counterpart of
\resizebox{<h-size>}{<v-size>}
is missing too, since
\box_resize:Nnn<box>{<h-size>}{<v-size>} is
actually
\resizebox*{<h-size>}{<v-size>}
that is, after resizing, the box' totalheight is set to <v-scale>,
thus, something like \box_resize_to_wd_and_ht:Nnn to set width and
height.
Regards,
Alexander.
If we are having one here we should have the other: I'll add.
Thanks a lot for taking it into consideration.

Alexander
Joseph Wright
2014-07-03 08:16:32 UTC
Permalink
Post by Alexander Grahn
Hi Joseph,
Post by Joseph Wright
Post by Alexander Grahn
Post by Will Robertson
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,
I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.
Thanks, Will.
The direct l3 counterpart of
\resizebox{<h-size>}{<v-size>}
is missing too, since
\box_resize:Nnn<box>{<h-size>}{<v-size>} is
actually
\resizebox*{<h-size>}{<v-size>}
that is, after resizing, the box' totalheight is set to <v-scale>,
thus, something like \box_resize_to_wd_and_ht:Nnn to set width and
height.
Regards,
Alexander.
If we are having one here we should have the other: I'll add.
Thanks a lot for taking it into consideration.
Alexander
This will be in the next release. Three questions:

1. Is this urgent (I can do a release if required)?
2. Does it still make sense to have the 'basic' function
as equivalent to "wd_and_ht_plus_dp", and if so do
we need the latter as a equivalent 'systematic' function?
3. Are these more complex possibilities needed for \coffins_...?
(Currently there is only \coffin_resize:Nnn.)
--
Joseph Wright
David Carlisle
2014-07-03 11:33:31 UTC
Permalink
Post by Joseph Wright
3. Are these more complex possibilities needed for \coffins_...?
(Currently there is only \coffin_resize:Nnn.)
I suspect not, a classic box just has three associated lengths so that
pretty much determines
the "packaged" resize combinations.

But for a coffin the equivalent of height/depth is really the y
coordinates of any handle
relative to the total height; and width similarly can be split by the x
coordinate of any handle
thus I think there are too many possibilities to wrap these in simple
named commands and the caller
will need to calculate the scale factors required.

David
Joseph Wright
2014-07-03 12:47:28 UTC
Permalink
Post by David Carlisle
Post by Joseph Wright
3. Are these more complex possibilities needed for \coffins_...?
(Currently there is only \coffin_resize:Nnn.)
I suspect not, a classic box just has three associated lengths so that
pretty much determines
the "packaged" resize combinations.
But for a coffin the equivalent of height/depth is really the y
coordinates of any handle
relative to the total height; and width similarly can be split by the x
coordinate of any handle
thus I think there are too many possibilities to wrap these in simple
named commands and the caller
will need to calculate the scale factors required.
David
Good points and a handily defensible position :-)
--
Joseph Wright
Alexander Grahn
2014-07-03 12:14:11 UTC
Permalink
Post by Joseph Wright
Post by Alexander Grahn
Hi Joseph,
Post by Joseph Wright
Post by Alexander Grahn
Post by Will Robertson
Post by Alexander Grahn
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Hi Alexander,
I’ve added this function to l3candidates for consideration — it sounds like a sensible request to me.
Thanks, Will.
The direct l3 counterpart of
\resizebox{<h-size>}{<v-size>}
is missing too, since
\box_resize:Nnn<box>{<h-size>}{<v-size>} is
actually
\resizebox*{<h-size>}{<v-size>}
that is, after resizing, the box' totalheight is set to <v-scale>,
thus, something like \box_resize_to_wd_and_ht:Nnn to set width and
height.
Regards,
Alexander.
If we are having one here we should have the other: I'll add.
Thanks a lot for taking it into consideration.
Alexander
1. Is this urgent (I can do a release if required)?
As for me, there is no rush. I guess `graphics' will continue to be
loaded automatically by expl3 in the medium term. So, in my package,
I am using \resizebox directly for the missing cases.

Alexander
Joseph Wright
2014-07-03 12:46:40 UTC
Permalink
Post by Alexander Grahn
As for me, there is no rush. I guess `graphics' will continue to be
loaded automatically by expl3 in the medium term. So, in my package,
I am using \resizebox directly for the missing cases.
Alexander
You can certainly stick with graphicx, but note that we've switched the
driver code to default to 'native' mode. As a result, if you want
graphicx loaded you really should have the appropriate \RequirePackage line.
--
Joseph
Joseph Wright
2014-06-29 13:29:55 UTC
Permalink
Post by Alexander Grahn
Hello,
some of the possible `\resizebox` usages don't map to corresponding
l3box functions.
In particular, I am looking for
\resizebox{<h-size>}{<v-size>}
and
\resizebox{!}{<v-size>}
The first one resizes width and height of the original box to the provided
<h-size> and <v-size> values and the second one only the height, while
maintaining the original aspect ratio of the box content.
The existing \box_resize:Nnn resizes width and totalheight, but I am
looking for resizing width and height.
There is a \box_resize_to_ht_plus_dp:Nn, but \box_resize_to_ht:Nn is
missing.
Could they be provided in a future l3box version?
Thanks and kind regards,
Alexander
I've not noted it down, but I think the reason I went for just 'total
height' functions here is that the end result then has a dimension (or
dimensions) that are explicit in the code. Something like

\box_resize_to_ht:Nn

gives you a box that is not necessarily the vertical size you've put
into your code, which could be regarded as a bit odd. (It's also doable
by viewing this operation as a scaling to ht_new/ht_old.) Of course,
this might just be me: one reason these are in the 'candidates' part of
l3kernel is they've not been discussed a lot, so some feedback is almost
certainly required.
--
Joseph Wright
Loading...