tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

Problem with using counters in version 2025A

Open samcarter opened this issue 6 months ago • 4 comments

The following example compiles fine with version 2024A:

\documentclass{article}

\usepackage{tabularray}

\begin{document}

\begin{tblr}{
  vlines = {1-\thepage}{solid},
}
    first & tblr \\   
   second & tblr \\ 
\end{tblr}

\end{document}

With version 2025A, it will produce the following error:

! Undefined control sequence.
\l__tl_tmpa_tl ->\__tblr_child_indexer_ 
                                        1
l.12 \end
         {tblr}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   \__int_sep: 
l.12 \end
         {tblr}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

Full .log file
This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex 2025.6.30)  30 JUN 2025 12:31
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**document.tex
(./document.tex
LaTeX2e <2025-06-01> patch level 1
L3 programming layer <2025-06-09>
(/usr/local/texlive/2025/texmf-dist/tex/latex/base/article.cls
Document Class: article 2025/01/22 v1.4n Standard LaTeX document class
(/usr/local/texlive/2025/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option)
)
\c@part=\count275
\c@section=\count276
\c@subsection=\count277
\c@subsubsection=\count278
\c@paragraph=\count279
\c@subparagraph=\count280
\c@figure=\count281
\c@table=\count282
\abovecaptionskip=\skip49
\belowcaptionskip=\skip50
\bibindent=\dimen148
)
(/usr/local/texlive/2025/texmf-dist/tex/latex/tabularray/tabularray.sty
Package: tabularray 2025-03-11 v2025A Typeset tabulars and arrays with LaTeX3
\l__tblr_a_int=\count283
\l__tblr_c_int=\count284
\l__tblr_r_int=\count285
\l__tblr_d_dim=\dimen149
\l__tblr_h_dim=\dimen150
\l__tblr_o_dim=\dimen151
\l__tblr_p_dim=\dimen152
\l__tblr_q_dim=\dimen153
\l__tblr_r_dim=\dimen154
\l__tblr_s_dim=\dimen155
\l__tblr_t_dim=\dimen156
\l__tblr_v_dim=\dimen157
\l__tblr_w_dim=\dimen158
\l__tblr_a_box=\box53
\l__tblr_b_box=\box54
\l__tblr_c_box=\box55
\l__tblr_d_box=\box56
\c@tblrcount=\count286
\c@rownum=\count287
\c@colnum=\count288
\c@rowcount=\count289
\c@colcount=\count290
\abovesep=\dimen159
\belowsep=\dimen160
\leftsep=\dimen161
\rightsep=\dimen162
\gTblrLevelInt=\count291
\g__tblr_data_row_key_count_int=\count292
\g__tblr_data_column_key_count_int=\count293
\g__tblr_data_cell_key_count_int=\count294
\g__tblr_array_int=\count295
\l__tblr_key_count_int=\count296
\l__tblr_key_quotient_int=\count297
\l__tblr_key_quotient_two_int=\count298
\l__tblr_key_remainder_int=\count299
\g__tblr_data_str_value_count_int=\count300
\lTblrChildTotalInt=\count301
\lTblrChildHtotalInt=\count302
\lTblrChildVtotalInt=\count303
\l__child_diff_h_int=\count304
\l__child_diff_v_int=\count305
\l__child_sign_h_int=\count306
\l__child_sign_v_int=\count307
\l__child_step_int=\count308
\lTblrDefaultHruleWidthDim=\dimen163
\lTblrDefaultVruleWidthDim=\dimen164
\l__tblr_split_balance_int=\count309
\l__tblr_strut_dp_dim=\dimen165
\l__tblr_strut_ht_dim=\dimen166
\g__tblr_cell_wd_dim=\dimen167
\g__tblr_cell_ht_dim=\dimen168
\g__tblr_cell_head_dim=\dimen169
\g__tblr_cell_foot_dim=\dimen170
\l__tblr_measured_cell_box=\box57
\g__tblr_last_box=\box58
\l__tblr_temp_box=\box59
\l__tblr_column_target_dim=\dimen171
\l__tblr_hfuzz_dim=\dimen172
\l__tblr_caption_box=\box60
\l__tblr_caption_left_box=\box61
\lTblrRowHeadInt=\count310
\lTblrRowFootInt=\count311
\l__tblr_row_head_box=\box62
\l__tblr_row_foot_box=\box63
\l__tblr_row_head_foot_dim=\dimen173
\lTblrTableWidthDim=\dimen174
\l__tblr_table_firsthead_box=\box64
\l__tblr_table_middlehead_box=\box65
\l__tblr_table_lasthead_box=\box66
\l__tblr_table_firstfoot_box=\box67
\l__tblr_table_middlefoot_box=\box68
\l__tblr_table_lastfoot_box=\box69
\l__tblr_remain_height_dim=\dimen175
\l__tblr_long_from_int=\count312
\l__tblr_long_to_int=\count313
\l__tblr_curr_i_int=\count314
\l__tblr_prev_i_int=\count315
\lTblrTablePageInt=\count316
\l__tblr_table_head_box=\box70
\l__tblr_table_foot_box=\box71
\l__tblr_table_head_foot_dim=\dimen176
\l__tblr_table_head_body_foot_dim=\dimen177
\l__tblr_table_box=\box72
\lTblrRowFirstInt=\count317
\lTblrRowLastInt=\count318
\l__tblr_table_hlines_box=\box73
\l__tblr_hline_box=\box74
\l__tblr_row_box=\box75
\l__tblr_col_o_wd_dim=\dimen178
\l__tblr_col_b_wd_dim=\dimen179
\l__tblr_hline_leftskip_dim=\dimen180
\l__tblr_hline_rightskip_dim=\dimen181
\l__tblr_row_ht_dim=\dimen182
\l__tblr_row_dp_dim=\dimen183
\l__tblr_row_abovesep_dim=\dimen184
\l__tblr_row_belowsep_dim=\dimen185
\l__tblr_row_vlines_box=\box76
\l__tblr_vline_box=\box77
\l__tblr_cell_box=\box78
\l__tblr_row_upper_dim=\dimen186
\l__tblr_row_lower_dim=\dimen187
\l__tblr_row_vpace_dim=\dimen188
\l__tblr_vline_aboveskip_dim=\dimen189
\l__tblr_vline_belowskip_dim=\dimen190
\lTblrCellRowSpanInt=\count319
\lTblrCellColSpanInt=\count320
\l__tblr_cell_wd_dim=\dimen191
\l__tblr_cell_ht_dim=\dimen192
\lTblrCellAboveBorderWidthDim=\dimen193
\lTblrCellBelowBorderWidthDim=\dimen194
\lTblrCellLeftBorderWidthDim=\dimen195
\lTblrCellRightBorderWidthDim=\dimen196
\l__tblr_diag_box=\box79
\l__tblr_cell_inner_wd_dim=\dimen197
\l__tblr_cell_inner_dp_dim=\dimen198
\l__tblr_cell_hanchor_dim=\dimen199
\l__tblr_last_cell_table_ht_dim=\dimen256
\l__tblr_last_cell_table_dp_dim=\dimen257
\l__tblr_last_vline_wd_dim=\dimen258
\l__tblr_tikz_node_box=\box80
)
(/usr/local/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2025-06-09 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count321
)
(./document.aux)
\openout1 = `document.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.

! Undefined control sequence.
\l__tl_tmpa_tl ->\__tblr_child_indexer_ 
                                        1
l.12 \end
         {tblr}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   \__int_sep: 
l.12 \end
         {tblr}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Undefined control sequence.
\l__tl_tmpa_tl ->\__tblr_child_indexer_ 
                                        1
l.12 \end
         {tblr}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   \__int_sep: 
l.12 \end
         {tblr}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Undefined control sequence.
\l__tl_tmpa_tl ->\__tblr_child_indexer_ 
                                        1
l.12 \end
         {tblr}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Missing number, treated as zero.
<to be read again> 
                   \__int_sep: 
l.12 \end
         {tblr}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 12.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 12.


[1

{/usr/local/texlive/2025/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./document.aux)
 ***********
LaTeX2e <2025-06-01> patch level 1
L3 programming layer <2025-06-09>
 ***********
 ) 
Here is how much of TeX's memory you used:
 2561 strings out of 467888
 65137 string characters out of 5434067
 452444 words of memory out of 5000000
 31193 multiletter control sequences out of 15000+600000
 627788 words of font info for 43 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 43i,6n,89p,152b,476s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>

Output written on document.pdf (1 page, 13415 bytes).
PDF statistics:
 13 PDF objects out of 1000 (max. 8388607)
 7 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

samcarter avatar Jun 30 '25 10:06 samcarter

As a workaround, you can create a new child indexer:

\documentclass{article}
\usepackage{tabularray}
\NewTblrChildIndexer{Page}{\def\lTblrChildIndexTl{\thepage}}
\begin{document}

\setcounter{page}{3}

\begin{tblr}{vlines={1-Page}{solid}}
  A & B \\
  C & D \\
  E & F \\
  G & H \\
\end{tblr}

\end{document}

A child indexer can accept arguments, such as

\documentclass{article}
\usepackage{tabularray}
\NewTblrChildIndexer{Page}[1][1]{\def\lTblrChildIndexTl{\inteval{\thepage+1-#1}}}
\begin{document}

\setcounter{page}{3}

\begin{tblr}{vlines={1-Page[2]}{solid}}
  A & B \\
  C & D \\
  E & F \\
  G & H \\
\end{tblr}

\end{document}

lvjr avatar Jun 30 '25 23:06 lvjr

Thanks a lot! This works perfectly!

samcarter avatar Jul 01 '25 07:07 samcarter

I decide to keep this issue open. It might be possible to make the old code work in a future release.

lvjr avatar Sep 02 '25 11:09 lvjr

It might be possible to make the old code work in a future release.

Oh, that would be great! Your solution with \NewTblrChildIndexer works perfectly fine, but being able to use the counters directly was more convenient.

samcarter avatar Sep 02 '25 11:09 samcarter