[latex3-commits] [latex3/latex3] object-tracking: Adjust how block/location is calculated (4645f0a76)

github at latex-project.org github at latex-project.org
Sun Mar 31 12:55:37 CEST 2024


Repository : https://github.com/latex3/latex3
On branch  : object-tracking
Link       : https://github.com/latex3/latex3/commit/4645f0a766cd9b249a688a20b54ee98e6c88fcde

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

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

    Adjust how block/location is calculated


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

4645f0a766cd9b249a688a20b54ee98e6c88fcde
 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.