[latex3-commits] [latex3/latex3] main: Ensure autosize inputs are dims (see #1502) (0c32d91a5)

github at latex-project.org github at latex-project.org
Fri Mar 8 12:27:39 CET 2024


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/0c32d91a5b95f5067c3966efa1ed56cd4f435521

>---------------------------------------------------------------

commit 0c32d91a5b95f5067c3966efa1ed56cd4f435521
Author: Joseph Wright <joseph at texdev.net>
Date:   Fri Mar 8 11:25:44 2024 +0000

    Ensure autosize inputs are dims (see #1502)


>---------------------------------------------------------------

0c32d91a5b95f5067c3966efa1ed56cd4f435521
 l3kernel/CHANGELOG.md | 2 ++
 l3kernel/l3box.dtx    | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index ba3ccfe71..7e5a82480 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -9,6 +9,8 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Changed
 - Require that `expl3` is loaded at top level in generic mode
+- Ensure that the dimension arguments to `\box_autosize_to_...:Nnn`
+  are properly formed (issue \#1502)
 
 ### Fixed
 - Typeset `TF` of internal conditionals in current color (issue \#730)
diff --git a/l3kernel/l3box.dtx b/l3kernel/l3box.dtx
index 6c61a0c87..81290c646 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -2297,8 +2297,9 @@
   {
     #5 #1
       {
-        \fp_set:Nn \l_@@_scale_x_fp { ( #2 ) / \box_wd:N #1 }
-        \fp_set:Nn \l_@@_scale_y_fp { ( #3 ) / ( #4 ) }
+        \fp_set:Nn \l_@@_scale_x_fp { ( \dim_to_fp:n {#2} ) / \box_wd:N #1 }
+        \fp_set:Nn \l_@@_scale_y_fp
+          { (  \dim_to_fp:n {#3} ) / ( \dim_to_fp:n {#4} ) }
         \fp_compare:nNnTF \l_@@_scale_x_fp > \l_@@_scale_y_fp
           { \fp_set_eq:NN \l_@@_scale_x_fp \l_@@_scale_y_fp }
           { \fp_set_eq:NN \l_@@_scale_y_fp \l_@@_scale_x_fp }





More information about the latex3-commits mailing list.