Quantcast
Channel: Rectangular table with consecutive integers using foreach - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 4

Rectangular table with consecutive integers using foreach

$
0
0

I'd like to have a rectangular table with integers (like a lottery ticket), let's say 4x9, numbers from 1 to 36.I assumed that it is easy with tikz, two foreach loops. Like this:

\foreach \i in {0,1,2,...,8}{  \foreach \j in {1,2,3,4}{    \draw[fill=blue!15] (\i,\j) rectangle (1+\i,1+\j);    \tikzmath{\k=9*(4-\j)+\i+1;}     \draw (\i+0.5,\j+.5) node {\k};  }}

But the numbers have the form 1.0, 2.0, etc, but I'd like to have 1, 2, etc.Could you help me?


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images