expl3
lets us measure box dimensions with:
\box_dp:N
\box_ht:N
\box_wd:N
but doesn't provide \box_ht_plus_dp:N
whilst it provides e.g. \box_resize_to_ht_plus_dp:Nn
.
Is there any reason for this?
A putative \box_ht_plus_dp:N
is simply \box_hT:N ... + \box_wd:N ...
. As all documented interfaces accept dimension expressions, this is pretty easy to input.
On the other hand, resizing to ht_plus_dp
requires internally that the code worries about maintaining the baseline and therefore ensuring that the height and depth are both scaled. That is different from simply scaling the height and hoping that other stuff 'comes out OK'.
_hT:N ... + \box_wd:N ...
. As all documented interfaces accept dimension expressions, this is pretty easy to input.
It is basically syntactic sugar, but I think the combination shows up often enough that it wouldn't be unreasonable to provide it.
@FrankMittelbach Sure, I was trying to answer the 'why doesn't it exist at all?' part - as you say, there's no reason we can't add it.
I have no opinion on whether to add it, but it was trivial to do, so we now have it in a branch, which can be merged if wanted.
Most helpful comment
It is basically syntactic sugar, but I think the combination shows up often enough that it wouldn't be unreasonable to provide it.