[latex3-commits] [latex3/latex3] develop, main: Adjust how block/location is calculated (9ca0cd08a)

github at latex-project.org github at latex-project.org
Tue Apr 9 16:17:02 CEST 2024


Repository : https://github.com/latex3/latex3
On branches: develop,main
Link       : https://github.com/latex3/latex3/commit/9ca0cd08afb9d17ccb5de5f234f34cc691c8e73c

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

commit 9ca0cd08afb9d17ccb5de5f234f34cc691c8e73c
Author: Joseph Wright <joseph at texdev.net>
Date:   Sun Mar 31 11:49:27 2024 +0100

    Adjust how block/location is calculated


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

9ca0cd08afb9d17ccb5de5f234f34cc691c8e73c
 l3kernel/l3pdf.dtx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/l3kernel/l3pdf.dtx b/l3kernel/l3pdf.dtx
index da9b1de3c..247f31d9a 100644
--- a/l3kernel/l3pdf.dtx
+++ b/l3kernel/l3pdf.dtx
@@ -468,21 +468,30 @@
     \exp_args:Ne \@@_backend_object_ref:n
       { \intarray_item:Nn #1 {#2} }
   }
+%    \end{macrocode}
+%   As we want blocks to start from one, and within the block for the top value
+%   to be \enquote{in} the block, we do a little bit of manipulation. By shifting
+%   down by one, we keep the values \enquote{in} the block, then we adjust the
+%   block/index number to get back on track.
+%    \begin{macrocode}
 \cs_new:Npn \@@_object_indexed_split:nnN #1#2#3
   {
     \use:e
       {
-        \exp_not:N #3
+        \exp_not:N #3`
           \exp_not:c
             {
               g_@@_object_ #1 _
               \int_eval:n
-                { \int_div_truncate:nn {#2} \c_@@_object_block_size_int }
+                {
+                  \int_div_truncate:nn { #2 - 1 }
+                    \c_@@_object_block_size_int + 1
+                }
               _intarray
             }
             {
               \int_eval:n
-                { \int_mod:nn {#2} \c_@@_object_block_size_int + 1 }
+                { \int_mod:nn { #2 - 1 } \c_@@_object_block_size_int + 1 }
             }
       }
   }





More information about the latex3-commits mailing list.