Latex3: Why not providing \box_ht_plus_dp?

Created on 4 May 2021  ·  4Comments  ·  Source: latex3/latex3

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?

expl3 feature-request

Most helpful comment

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

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frougon picture frougon  ·  6Comments

JairoAdelRio picture JairoAdelRio  ·  7Comments

dbitouze picture dbitouze  ·  12Comments

EvanAad picture EvanAad  ·  49Comments

bastien-roucaries picture bastien-roucaries  ·  19Comments