tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

caption counter advances by 2

Open eisenlohr opened this issue 3 years ago • 3 comments

One suggested solution to #103 mentioned

\DefTblrTemplate{firsthead}{default}{\captionof{table}{\InsertTblrText{caption}}}

but noted that this definition increments the caption counter by 2 instead of 1. This unwanted behavior is still present as of 2022B...

eisenlohr avatar Jun 23 '22 16:06 eisenlohr

Yes, you need to add \addtocounter{table}{-1}.

\DefTblrTemplate{firsthead}{default}{\addtocounter{table}{-1}\captionof{table}{\InsertTblrText{caption}}}

The counter is increased by both tabularray and captionof packages. And I think it can not be fixed in tabularray because I need to keep other tabularray templates safe.

lvjr avatar Jun 24 '22 01:06 lvjr

Yes, you need to add \addtocounter{table}{-1}.

With hyperref this leads to warnings about ignored destinations:

pdfTeX warning (ext4): destination with the same identifier (name{table.1}) has
 been already used, duplicate ignored
<argument> ...shipout:D \box_use:N \l_shipout_box 

u-fischer avatar Jun 28 '22 12:06 u-fischer

Ok, I will look into this warning later.

lvjr avatar Jun 28 '22 23:06 lvjr