add tag
Laurenso
I am trying to make a counter in the form 1, 2a, 2b, 3, 4a, 4b, 4c,... in the column 1 of tabularray. I don't know how to set up. I make this by hand at 2~a and 2~b. When I use 
```
\problem{3} & & 0.5\\
 & & 0.5\\
 & & 0.5\\
```
after `\SetCell[r=3]{m, font=\bfseries} 2~b)`

I get the Problem 2, not 3.
```
\documentclass[12pt,a4paper]{article}
\usepackage[hmargin=1.7cm, vmargin={1.8cm,1.7cm}]{geometry}
\usepackage{fouriernc}
\usepackage{ninecolors}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs, counter,
	diagbox, siunitx,  varwidth}
\sisetup{output-decimal-marker={,}}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{enumitem}
\newcounter{prob}
\NewTableCommand\problem[1]{\SetRow{bg=gray9}%
	\SetCell[r=#1]{h, cmd={\stepcounter{prob}\theprob}, bg=white}}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}


\begin{document}

	\begin{longtblr}[
		caption={Answer}]{hlines, vlines,
			colspec = {Q[c, h, font=\bfseries] X[valign=h] Q[c, si={table-format=1.2}]},
			cell{1}{2-3}={halign=c},
			row{1} = {yellow9, font=\bfseries, mode=text},
			rowsep = 5pt,
			rowhead = 1,
		} 
	Problem & Content   & Point     \\
\problem{3}	& Something & 1.00\\
	& & 0.5\\
		& & 0.5\\
\SetCell[r=4]{m, font=\bfseries}2~a)
 & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 \SetCell[r=3]{m, font=\bfseries} 2~b)
 & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 \problem{3} & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 	\end{longtblr} 
\end{document}
```

![image.png](/image?hash=d5ff7886e896cc1c289d02e036861677495b39075f3cf69c3cefb8b9fada376d)

How to make a counter in the form 1, 2a, 2b, 3, 4a, 4b, 4c,... in the column 1 of tabularray automatically?
Top Answer
samcarter
You could use a second counter:

```
\documentclass[12pt,a4paper]{article}
\usepackage[hmargin=1.7cm, vmargin={1.8cm,1.7cm}]{geometry}
\usepackage{fouriernc}
\usepackage{ninecolors}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs, counter,
	diagbox, siunitx,  varwidth}
\sisetup{output-decimal-marker={,}}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{enumitem}
\newcounter{prob}
\newcounter{subprob}

\NewTableCommand\firstsubproblem[1]{\SetRow{bg=gray9}%
	\SetCell[r=#1]{h, cmd={\setcounter{subprob}{0}\stepcounter{prob}\theprob~\stepcounter{subprob}\alph{subprob})}, bg=white}}
\NewTableCommand\subproblem[1]{\SetRow{bg=gray9}%
	\SetCell[r=#1]{h, cmd={\theprob~\stepcounter{subprob}\alph{subprob})}, bg=white}}
\NewTableCommand\problem[1]{\setcounter{subprob}{0}\SetRow{bg=gray9}%
	\SetCell[r=#1]{h, cmd={\stepcounter{prob}\theprob}, bg=white}}


\usepackage{tikz}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}


\begin{document}

	\begin{longtblr}[
		caption={Answer}]{hlines, vlines,
			colspec = {Q[c, h, font=\bfseries] X[valign=h] Q[c, si={table-format=1.2}]},
			cell{1}{2-3}={halign=c},
			row{1} = {yellow9, font=\bfseries, mode=text},
			rowsep = 5pt,
			rowhead = 1,
		} 
	Problem & Content   & Point     \\
\problem{3}	& Something & 1.00\\
	& & 0.5\\
		& & 0.5\\ 
 \firstsubproblem{4} & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 \subproblem{3} & & 0.5\\
 & & 0.5\\
 & & 0.5\\
 \problem{3} & & 0.5\\
 & & 0.5\\
 & & 0.5\\   
 	\end{longtblr} 
\end{document}
```

![Screenshot 2023-12-12 at 11.02.26.png](/image?hash=c06b20fd56f7a1248b89bb98b3ff04f2487a46b72e11d33cf9ab0554852f2924)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.