texlive[73347] Master/texmf-dist: tabularray-abnt (7jan25)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 7 22:02:16 CET 2025


Revision: 73347
          https://tug.org/svn/texlive?view=revision&revision=73347
Author:   karl
Date:     2025-01-07 22:02:16 +0100 (Tue, 07 Jan 2025)
Log Message:
-----------
tabularray-abnt (7jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tabularray-abnt/changelog.txt
    trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.pdf
    trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.tex
    trunk/Master/texmf-dist/tex/latex/tabularray-abnt/tabularray-abnt.sty

Modified: trunk/Master/texmf-dist/doc/latex/tabularray-abnt/changelog.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tabularray-abnt/changelog.txt	2025-01-07 21:02:07 UTC (rev 73346)
+++ trunk/Master/texmf-dist/doc/latex/tabularray-abnt/changelog.txt	2025-01-07 21:02:16 UTC (rev 73347)
@@ -1,2 +1,4 @@
+2025-01-06
+  - Added global counter for table/quadro to fix bug that mix page span status for table and quadro.
 2025-01-03
-- first public release
+  - first public release

Modified: trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.tex	2025-01-07 21:02:07 UTC (rev 73346)
+++ trunk/Master/texmf-dist/doc/latex/tabularray-abnt/tabularray-abnt-pt-br.tex	2025-01-07 21:02:16 UTC (rev 73347)
@@ -77,7 +77,7 @@
 
 \title{Tabularray-abnt: tema abnt para tabularray}
 \author{Sadao Massago}
-\date{03/01/2025}
+\date{06/01/2025}
 
 %%%%%%%%%%%%%%%%%%%%%
 % INÍCIO DO DOCUMENTO

Modified: trunk/Master/texmf-dist/tex/latex/tabularray-abnt/tabularray-abnt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tabularray-abnt/tabularray-abnt.sty	2025-01-07 21:02:07 UTC (rev 73346)
+++ trunk/Master/texmf-dist/tex/latex/tabularray-abnt/tabularray-abnt.sty	2025-01-07 21:02:16 UTC (rev 73347)
@@ -16,8 +16,8 @@
 
 %%% file name
 \ProvidesFile{tabularray-abnt.sty}
- [2025/01/03 tabularray-abnt style (require tabularray package)]
-\typeout{tabularray-abnt style 2025-01-03 <January/2025>.}
+ [2025/01/06 tabularray-abnt style (require tabularray package)]
+\typeout{tabularray-abnt style 2025-01-06 <January/2025>.}
 
 %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% It not works on older LaTeX compatibility mode (documentstyle)
@@ -51,6 +51,7 @@
 %% Required package
 
 \RequirePackage{tabularray}
+\UseTblrLibrary{hook}
 
 %%% %----------------------
 %%> \section{ABNT theme}
@@ -61,7 +62,10 @@
   \SetTblrTemplate{firsthead-text,lasthead-text,conthead-text}{abnt}
   \SetTblrTemplate{caption,lasthead,capcont}{abnt}
   \DefTblrTemplate{firstfoot,middlefoot}{default}{}% disabling the first and middle footnote
-  \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
+
+%%% \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
+
+  %% for abntexto, need to change lot write
   \if at tabularray@abnt at using@abntexto
     \SetTblrTemplate{caption-lot}{abnt}
   \fi
@@ -87,11 +91,14 @@
   \SetTblrTemplate{firsthead-text,lasthead-text,conthead-text}{abnt}
   \SetTblrTemplate{caption,lasthead,capcont}{abnt}
   \DefTblrTemplate{firstfoot,middlefoot}{default}{}% desabling first and middle footnote
-  \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
-  \if at tabularray@abnt at using@abntexto
-    \SetTblrTemplate{caption-lot}{abnt}
-  \fi
+
+%%% \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
   
+%%%  %% for abntexto, need to change lot write
+%%%  \if at tabularray@abnt at using@abntexto
+%%%  %%\SetTblrTemplate{caption-lot}{abnt}
+%%%  \fi
+  
   \SetTblrTemplate{remark-tag}{abnt}
   \SetTblrTemplate{remark}{abnt}
 
@@ -100,8 +107,8 @@
   \SetTblrStyle{lastfoot}{font=\footnotesize}
 
   %% Change specific for ``quadro'
-  \SetTblrTemplate{caption-tag}{quadro}
-  \SetTblrTemplate{caption-lot}{quadro}
+  \SetTblrTemplate{caption-tag}{quadro} % caption change
+  \SetTblrTemplate{caption-lot}{quadro} % lot wire change
 } 
 
 %%% -----------------------------
@@ -117,7 +124,22 @@
   \fi
 \fi
 
-%% additional texto for header
+%% counting table and quadro together
+
+%%% \ExplSyntaxOn
+\if at tabularray@abnt at using@abntexto
+
+%%%  \newcommand{\tabularray at abnt@tblr at count@roman}{\romannumeral\inteval{\g__tblr_table_count_int + \countquadro}}
+  \newcommand{\tabularray at abnt@tblr at count@roman}{\romannumeral\inteval{\value{table} + \countquadro}}
+\else
+
+%%%  \newcommand{\tabularray at abnt@tblr at count@roman}{\romannumeral\inteval{\g__tblr_table_count_int + \value{quadro}}}
+  \newcommand{\tabularray at abnt@tblr at count@roman}{\romannumeral\inteval{\value{table} + \value{quadro}}}  
+\fi
+
+%%% \ExplSyntaxOff
+
+%% additional text for header
 \DefTblrTemplate{firsthead-text}{abnt}{\par~\hfill(continua)} % first header
 \DefTblrTemplate{lasthead-text}{abnt}{\par~\hfill(conclusão)} % last header
 \DefTblrTemplate{conthead-text}{abnt}{\par~\hfill(continuação)} % middle header
@@ -128,8 +150,12 @@
   \UseTblrTemplate{caption-text}{default}
   
 %%% % like \ifdefined, but with csname
-  \ifcsname tblr at abnt@spanpages@\roman{table}\endcsname % if span pages
-    \UseTblrTemplate{firsthead-text}{abnt} % acrescentar o firsthead-text
+  \ifcsname tabularray at abnt@tblr at spanpages@\tabularray at abnt@tblr at count@roman\endcsname % if span pages
+    \UseTblrTemplate{firsthead-text}{abnt} % add the firsthead-text
+
+%%% DEBUG:\tabularray at abnt@tblr at count@roman
+%%%  \else
+%%%    DEBUG (no span pages): \roman{tabularray at abnt@global at tblr@counter}
   \fi
 }
 
@@ -151,50 +177,104 @@
 %%% %-------------------------------------------------
 %%> \section{To save ``page span'' status}
 
-\newif\if at tablular@abnt at mark@spanpages%
-\@tablular at abnt@mark at spanpagesfalse % initially false
+\newif\if at tablularray@abnt at mark@spanpages
 
-%%% % tblr with long optional option  
-\AddToHook{env/tblr/before}
-{  
-  \@tablular at abnt@mark at spanpagestrue
-}
-\AddToHook{env/tblr/after}
-{  
-  \@tablular at abnt@mark at spanpagesfalse
-  \DefTblrTemplate{lastfoot-text}{abnt}{}   
-  \DefTblrTemplate{lastfoot-text-note}{abnt}{}            
-}
+%%% \AtBeginDocument{%
 
-%%% % longtblr
-\AddToHook{env/longtblr/before}
-{  
-  \@tablular at abnt@mark at spanpagestrue
-}
-\AddToHook{env/longtblr/after}
-{  
-  \@tablular at abnt@mark at spanpagesfalse
-  \DefTblrTemplate{lastfoot-text}{abnt}{}          
-  \DefTblrTemplate{lastfoot-text-note}{abnt}{}  
-}
+%%% % \@tablularray at abnt@mark at spanpagesfalse % initially false
+\global\let\if at tablularray@abnt at mark@spanpages\iffalse
 
+%%% } % \AtBeginDocument{%
+
+%%% hook tabularray not working as expected. Need more recente version of tabularray?
+%%% \AddToHook{tabularray/table/before}
+%%% {  
+ 
+%%% % \@tablularray at abnt@mark at spanpagestrue
+%%%  \global\let\if at tablularray@abnt at mark@spanpages\iftrue
+%%% }
+%%% \AddToHook{tabularray/table/after}
+%%% {  
+
+%%%%  \@tablularray at abnt@mark at spanpagesfalse
+%%%   \global\let\if at tablularray@abnt at mark@spanpages\iffalse
+%%% }
+
+%%% % check page span status for longtblr
+\AddToHook{env/longtblr/after}{ \global\let\if at tablularray@abnt at mark@spanpages\iftrue }
+\AddToHook{env/longtblr/end}{ \global\let\if at tablularray@abnt at mark@spanpages\iffalse }
+
+%%% % check page span status for tblr (with possible long option) 
+\AddToHook{env/tblr/after}{ \global\let\if at tablularray@abnt at mark@spanpages\iftrue }
+\AddToHook{env/tblr/end}{ \global\let\if at tablularray@abnt at mark@spanpages\iffalse }
+
+%%% % check page span status for tblr like env
+%%% % Not work as exprected
+%%% \AddToHook{tabularray/table/before}{ \global\let\if at tablularray@abnt at mark@spanpages\iftrue }
+%%% \AddToHook{tabularray/table/after}{ \global\let\if at tablularray@abnt at mark@spanpages\iffalse }
+
+%%% {
+
+
+%%% \AddToHook{env/longtblr/begin}
+%%% {  
+
+%%% %  \@tablularray at abnt@mark at spanpagestrue
+%%%   \global\let\if at tablularray@abnt at mark@spanpages\iftrue
+%%% }
+
+%%% \AddToHook{env/longtblr/end}
+%%% {  
+
+%%%  \@tablularray at abnt@mark at spanpagesfalse
+%%%   \global\let\if at tablularray@abnt at mark@spanpages\iffalse
+%%% }
+
+%%% % For tblr with long opcion 
+%%% \AddToHook{env/tblr/begin}
+%%% {  
+
+%%% %  \@tablularray at abnt@mark at spanpagestrue
+%%%   \global\let\if at tablularray@abnt at mark@spanpages\iftrue
+%%% }
+
+%%% \AddToHook{env/tblr/end}
+%%% {  
+
+%%% %   \@tablularray at abnt@mark at spanpagesfalse
+%%%   \global\let\if at tablularray@abnt at mark@spanpages\iffalse
+%% }
+
+%%% talltblr fit in single page (no hook)
+
 %% if change pages, mark as ``span pages'' on aux file
+
+%%% \AddToHook{shipout/after}
 \AddToHook{shipout/after}
 {
-  \if at tablular@abnt at mark@spanpages
+  \if at tablularray@abnt at mark@spanpages
+    %% to the associated commands act globally
     %% tip from https://tex.stackexchange.com/questions/115932/on-the-basics-of-writing-to-reading-from-auxiliary-files-aux-toc-etc
-    \immediate\write\@auxout{\gdef\string\tblr at abnt@spanpages@\roman{table}{true}}
-  \fi
+    \immediate\write\@auxout{\gdef\string\tabularray at abnt@tblr at spanpages@\tabularray at abnt@tblr at count@roman{true}}
+
+%%% \else % DEBUG
+%%%      \immediate\write\@auxout{\gdef\string\tabularray at abnt@tblr at spanpages@\tabularray at abnt@tblr at count@roman{false}}
+    
+\fi  
   %% to the associated commands act globally
   %% tip from https://tex.stackexchange.com/questions/566884/setting-a-newif-to-false-ignored-on-first-check-in-custom-itemize-environment
-  \global\let\if at tablular@abnt at mark@spanpages\iffalse
-}    
+  \global\let\if at tablularray@abnt at mark@spanpages\iffalse
+  
+%%%  % DEBUG:
+%%%  \immediate\write\@auxout{\gdef\string\tabularray at abnt@shipout at message{DEGUB: page=\thepage, tblrnum=\tabularray at abnt@tblr at count@roman}} 
+}  
 
 %% For abntexto class, need change the form to write on ``lot''
+%% For others, only add global counter
 \if at tabularray@abnt at using@abntexto
   \ExplSyntaxOn
     \DefTblrTemplate{caption-lot}{abnt}
-    {      
+    {
       \tl_if_empty:NTF \lTblrEntryTl
         {\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl}
         {\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl}
@@ -204,9 +284,22 @@
       \addtoext{lot}{lofi}{\protect\lotlabelbox{\thetable}{\l__tblr_caption_short_tl}}        
     }
   \ExplSyntaxOff
+%%%\else% \if at tabularray@abnt at using@abntexto
+%%%  \ExplSyntaxOn
+%%%    \DefTblrTemplate {caption-lot}{abnt}
+%%%    {
+%%%    
+%%% %%      \stepcounter{tabularray at abnt@global at tblr@counter}% global table/quadro counter    
+%%%      \tl_if_empty:NTF \lTblrEntryTl
+%%%        { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl }
+%%%        { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl }
+%%%      \addcontentsline { lot } { table }
+%%%        { \protect\numberline { \thetable } { \l__tblr_caption_short_tl } }
+%%%    }
+%%%  \ExplSyntaxOff   
 \fi% \if at tabularray@abnt at using@abntexto
 
-%% Change reamrk to use for source and note as ABNT
+%% Change remark to use for source and note as ABNT
 \DefTblrTemplate{remark-tag}{abnt}{\InsertTblrRemarkTag}
 
 %% Change left margin using tip from
@@ -230,6 +323,12 @@
 \providecommand{\quadroname}{Quadro}
 \providecommand{\listquadroname}{Lista de quadros}
 \@ifpackageloaded{babel}{
+  \ifdefined\captionsportugese
+    \addto\captionsportugese{% portugese
+      \renewcommand{\quadroname}{Quadro}
+      \renewcommand{\listquadroname}{Lista de quadros}
+    }
+  \fi
   \ifdefined\captionsbrazil
     \addto\captionsbrazil{% brazilian portugese
       \renewcommand{\quadroname}{Quadro}
@@ -237,7 +336,7 @@
     }
   \fi
   \ifdefined\captionsbrazilian
-    \addto\captionsbrazil{% brazilian portugese
+    \addto\captionsbrazilian{% brazilian portugese
       \renewcommand{\quadroname}{Quadro}
       \renewcommand{\listquadroname}{Lista de quadros}
     }
@@ -257,20 +356,21 @@
   %% using command from ABNTexto  
   \definelegendplace{quadro}{Quadro}{quad.\,}{loq} % new legend entry 
 
-\ifdefined\chapter
-  \newcommand{\listadequadros}{\notoc\nonum\chapter{\listquadroname}\makeloq} 
-\else
-  \newcommand{\listadequadros}{\notoc\nonum\section{\listquadroname}\makeloq} 
-\fi
+  \ifdefined\chapter
+    \newcommand{\listadequadros}{\notoc\nonum\chapter{\listquadroname}\makeloq} 
+  \else
+    \newcommand{\listadequadros}{\notoc\nonum\section{\listquadroname}\makeloq} 
+  \fi
   %% Caution: don't put space between braces and parameters
   \DefTblrTemplate{caption-tag}{quadro}{\quadroname\hspace{0.25em}\the\countquadro}
 
   \ExplSyntaxOn
-    \DefTblrTemplate {caption-lot}{quadro}
+    \DefTblrTemplate{caption-lot}{quadro}
     {
-      \addtocounter{table}{-1}%Não contar como table
-      
-  %% counter created by \definelegendplace{quadro} is not \c at quadro+, but \countquadro, and is necessary to use TeX command to increase
+    
+%%%      \stepcounter{tabularray at abnt@global at tblr@counter}% global table/quadro counter
+      \addtocounter{table}{-1}%Não contar como table      
+      %% counter created by \definelegendplace{quadro} is not \c at quadro+, but \countquadro, and is necessary to use TeX command to increase
       \global\advance\countquadro by 1% count as ``quadro''
       \tl_if_empty:NTF \lTblrEntryTl
         {\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl}
@@ -307,10 +407,12 @@
   \DefTblrTemplate {caption-tag} {quadro} {\quadroname\hspace{0.25em}\thequadro}
 
   \ExplSyntaxOn
-    \DefTblrTemplate { caption-lot } { quadro }
+    \DefTblrTemplate{caption-lot}{quadro}
     {
-      \addtocounter{table}{-1}
-      \stepcounter{quadro}
+    
+%%%      \stepcounter{tabularray at abnt@global at tblr@counter}% global table/quadro counter    
+      \addtocounter{table}{-1}% not count as table
+      \stepcounter{quadro}% count as quadro
       \tl_if_empty:NTF \lTblrEntryTl
         { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl }
         { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl }
@@ -327,12 +429,12 @@
 %% To set table font for new envrronment
 \NewDocumentCommand{\SetAbntTblrFont}{+m}
 {
-  \gdef\AbntTblrFont{#1}
+  \gdef\@tabularray at abnt@tblr at font{#1}
 }
 
 %%% % New environments for tables
 \NewDocumentEnvironment{abnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+\ifdefined\@tabularray at abnt@tblr at font \@tabularray at abnt@tblr at font \fi
 \begin{tblr}[theme=abnt,#1]{#2}
 #3
 \end{tblr}
@@ -339,17 +441,44 @@
 }{}
 
 \NewDocumentEnvironment{tallabnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+
+%%% tallabnttblr begin
+%%%   \if at tablularray@abnt at mark@spanpages
+%%%   DEBUG: mark span pages active
+%%%  \fi
+%%%   table+quadro counter = \tabularray at abnt@tblr at count@roman
+\ifdefined\@tabularray at abnt@tblr at font \@tabularray at abnt@tblr at font \fi
 \begin{talltblr}[theme=abnt,#1]{#2}
 #3
 \end{talltblr}
+
+%%%   tallabnttblr end
+%%%   \if at tablularray@abnt at mark@spanpages
+%%%  DEBUG: mark span pages active
+%%%  \fi
+%%%  table+quadro counter = \tabularray at abnt@tblr at count@roman
 }{}
 
 \NewDocumentEnvironment{longabnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+
+%%% longabnttblr begin
+%%%   \if at tablularray@abnt at mark@spanpages
+%%%   DEBUG: mark span pages active
+%%%   \fi
+%%%   table+quadro counter = \tabularray at abnt@tblr at count@roman
+%%% \global\let\if at tablularray@abnt at mark@spanpages\iftrue
+\ifdefined\@tabularray at abnt@tblr at font \@tabularray at abnt@tblr at font \fi
 \begin{longtblr}[theme=abnt,#1]{#2}
 #3
 \end{longtblr}
+
+%%% \global\let\if at tablularray@abnt at mark@spanpages\iffalse
+
+%%% longabnttblr end
+%%% \if at tablularray@abnt at mark@spanpages
+%%%   DEBUG: mark span pages active
+%%%   \fi
+%%%   table+quadro counter = \tabularray at abnt@tblr at count@roman
 }{}
 
 %% end: tabularray-abnt.sty



More information about the tex-live-commits mailing list.