LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Benjamin Berg <[log in to unmask]>
Mon, 3 Aug 2015 12:47:25 +0200
text/plain (1085 bytes) , tabularcount.tex (935 bytes) , signature.asc (180 bytes)

I am having trouble to understand what the difference between
\addtocounter and \int_gincr:N is. When used inside a tabularx
environment, the \int_* functions do not work correctly, but the normal
LaTeX counters do.

Maybe the idea of even using counters in a tabularx environment like
this is totally wrong[1], but it feels to me like the two commands
should behave in the same way. So either I am not grasping some
concepts (feel free to just point me to an explanation) or there might
even be a small bug.

So, the attached document will print two tables. For each cell the
output of "\int_use:N \g_test_int,~\thetestcount" is displayed. The
counter is behaving as I expect while the \g_test_int has different
values inside tabularx.

3, 1    4, 2    1, 3    2, 4
3, 1    4, 2

and tabular:
1, 1    2, 2    3, 3    4, 4
1, 1    2, 2

It looks like this has to do with the fact that in the second row there
are empty cells. But it still baffles me, that the latex counters
behave correctly, while latex 3 integers do not.


[1] It is very likely that I will drop the tabularx anyways.