summaryrefslogtreecommitdiff
path: root/macros/generic/texdimens/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'macros/generic/texdimens/README.md')
-rw-r--r--macros/generic/texdimens/README.md58
1 files changed, 38 insertions, 20 deletions
diff --git a/macros/generic/texdimens/README.md b/macros/generic/texdimens/README.md
index c0ba961f30..107f8d73c0 100644
--- a/macros/generic/texdimens/README.md
+++ b/macros/generic/texdimens/README.md
@@ -10,7 +10,7 @@ LPPL 1.3c. See file LICENSE.md.
Repository: https://github.com/jfbu/texdimens
-Release: `0.99d 2021/11/04`
+Release: `1.0 2021/11/10`
## Usage
@@ -30,21 +30,33 @@ available TeX units, to the extent possible.
This package provides expandable macros:
-- `\texdimenpt`,
-- `\texdimenUU`, `\texdimenUUup` and
- `\texdimenUUdown` with `UU` standing for one of `bp`, `cm`, `mm`, `in`,
- `pc`, `cc`, `nc`, `dd` and `nd`,
-- `\texdimenbothincm` (and relatives, see full documentation),
+- `\texdimenUU` with `UU` standing for one of `pt`, `bp`, `cm`, `mm`,
+ `in`, `pc`, `cc`, `nc`, `dd` and `nd`,
+- `\texdimenUUup` and `\texdimenUUdown` with `UU` as above except `pt`,
+- `\texdimenbothincm` and relatives,
+- `\texdimenbothbpmm` and relatives,
- `\texdimenwithunit`.
-For example `\texdimenbp` takes on input some dimension or dimension
-expression and produces on output a decimal `D` such that `D bp` is
-guaranteed to be the same dimension as the input, if that one admits any
-representation as `E bp`; else it will be either the closest match from
-above or from below (for this unit the error is at most `1sp`).
+`\texdimenbp` takes on input some dimension or dimension expression and
+produces on output a decimal `D` such that `D bp` is guaranteed to be
+the same dimension as the input, *if* it admits any representation as `E
+bp`; else it will be either the closest match from above or from
+below. For this unit, as well as for `nd` and `dd` the difference is at
+most `1sp`. For other units (not `pt` of course) the distance will
+usually be larger than `1sp` and one does not know if the approximant
+from the other direction would have been better or worst.
-The variants `\texdimenbpup` and `\texdimenbpdown` allow to choose the
-direction of approximation.
+The variants `\texdimenbpup` and `\texdimenbpdown` expand slightly less
+fast than `\texdimenbp` but they allow to choose the direction of
+approximation (in absolute value).
+
+The macros associated to the other units have
+the same descriptions.
+
+`\texdimenbothincm`, respectively `\texdimenbothbpmm`, find the largest
+(in absolute value) dimension not exceeding the input and exactly
+representable both with the `in` and `cm` units, respectively exactly
+representable both with the `bp` and `mm` units.
`\texdimenwithunit{<dimen1>}{<dimen2>}` produces a decimal `D` such that
`D \dimexpr dimen2\relax` is parsed by TeX into the same dimension as
@@ -54,9 +66,8 @@ attainable. If not attainable, the decimal `D` will ensure a closest
match from below or from above but one does not know if the
approximation from the other direction is better or worst.
-In a sense, this macro divides `<dimen1>` by `<dimen2>` but please refer
-to the full documentation (`texdimens.md`, `texdimens.pdf`) for relevant
-information on how TeX handles dimensions.
+In a sense, this macro divides `<dimen1>` by `<dimen2>`, see additional
+details in the complete macro description.
## Acknowledgements
@@ -64,10 +75,17 @@ Thanks to Denis Bitouzé for raising an
[issue](https://github.com/latex3/latex3/issues/953)
on the LaTeX3 tracker which became the initial stimulus for this package.
-Thanks to Ruixi Zhang for reviving the above linked-to thread
-and opening up here [issue #2](https://github.com/jfbu/texdimens/issues/2)
-asking to add handling of the `ex`,`em`, and `px` cases. This was done
-at release `0.99` via the addition of `\texdimenwithunit`.
+Thanks to Ruixi Zhang for reviving the above linked-to thread and
+opening up on the package issue tracker the
+[issue #2](https://github.com/jfbu/texdimens/issues/2) asking to add
+handling of the `ex` and `em` cases. This was done at release `0.99` via
+the addition of `\texdimenwithunit`.
+
+Renewed thanks to Ruixi Zhang for analyzing at
+[issue #10](https://github.com/jfbu/texdimens/issues/10) what is at
+stake into finding dimensions exactly representable both in the `bp` and
+`mm` units. Macros `\texdimenbothbpmm` and `\texdimenbothmmbp` now
+address this (release `1.0`).
<!--
-->