Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not providing \box_ht_plus_dp? #899

Closed
dbitouze opened this issue May 4, 2021 · 4 comments
Closed

Why not providing \box_ht_plus_dp? #899

dbitouze opened this issue May 4, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@dbitouze
Copy link
Contributor

dbitouze commented May 4, 2021

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?

@josephwright
Copy link
Member

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

@FrankMittelbach
Copy link
Member

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

@josephwright
Copy link
Member

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

@blefloch blefloch added enhancement New feature or request expl3 labels May 4, 2021
@blefloch
Copy link
Member

blefloch commented May 4, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants