# Numbering pst-asr diagrams in a table with gb4e

As a follow up to a previous question of mine, I am trying to use a pst-asr diagram inside both table and gb4e environments but am running into trouble. I am aiming to produce the image below:

But, using the following MWE:

\documentclass[a4paper,12pt,twoside]{article}
\usepackage{libertine}
\usepackage{wasysym}
\usepackage[table]{xcolor}
\definecolor{gri}{RGB}{230,230,230}
\usepackage{pst-asr}
\newtier{1n,2n,3n}
\psset{everyasr=\tiershortcuts, ph=0, ts=0,
1n=(ph) -2 1em 0.25em, 1nB=-2,
2n=(ph) -4 1em 0.25em, 2nB=-4,
3n=(ph) -6 1em 0.25em, 3nB=-6}
\usepackage{gb4e}
\usepackage{pifont}
\newcommand{\hand}{\ding{43}}
\usepackage{arydshln}
\begin{document}
\begin{exe}
\ex \textit{\emph{/CaCiC/} input; e.g. \emph{kwazis-} greet'}\\
%\begin{xlist}
\begin{tabular}
{|rl|c|c:c|}\hline
& /CaCiC/ & {\sc *Mid} & {\sc Ident}(hi) & {\sc *High} \\
\hline
& %\ex
\asr[reptype=nots,xgap=2em,syB=-2em,phB=0em] CaCeC|
\@(0.5,1n){[+lo]}
\-(1,ph)
\@(1.5,1n){[-hi]}
\-(1,ph)
\@(2.5,1n){[-lo]}
\-(3,ph)
\@(3.5,1n){[-hi]}
\-(3,ph)
\endasr
& *! & \cellcolor{gri} * & \cellcolor{gri} \\
\hline
\hand & %\ex
\asr[reptype=nots,xgap=2em,syB=-2em,phB=0em] CaCiC|
\@(0.5,1n){[+lo]}
\-(1,ph)
\@(1.5,1n){[-hi]}
\-(1,ph)
\@(2.5,1n){[-lo]}
\-(3,ph)
\@(3.5,1n){[+hi]}
\-(3,ph)
\endasr
& & & \cellcolor{gri} * \\
\hline
\end{tabular}
%\end{xlist}
\end{exe}
\end{document}


I can only get part of the way there:

Uncommenting the xlist environment and \exes in the MWE above results in 6 fatal errors. I compile the document in Texmaker using XeLaTeX.

• There's no way to use lists like this within a table. There are ways to autonumber things within the table if you really need that, but Herbert's solution is probably the simplest. You might also want to check out OTtablx for doing your OT tableaux. – Alan Munn Dec 3 '17 at 17:34
• Ah, I see, that's a shame. What are the "ways to autonumber things within the table"? (just out of curiosity) Thanks for the OT tableaux package suggestion. I am aware of that package and've used it in the past but found the way used in my MWE to be better for me. That said, if OTtablx can be used with pst-asr then I just might give it another go. – Miztli Dec 3 '17 at 17:56
• Well OTtablx automatically numbers candidates with the numbering scheme (arabic, alpha, etc.) passed as an option. And since it is also PSTricks based, it should work nicely with pst-asr. But more generally see Automatic table row numbers or How to enumerate the rows of a table. – Alan Munn Dec 3 '17 at 18:20
• Thanks for the help. Based on your first link, I've added \newcounter{tableaunumbers} \newcommand\OTex{\stepcounter{tableaunumbers}\alph{tableaunumbers}.\quad} \usepackage{etoolbox} \preto\tabular{\setcounter{tableaunumbers}{0}} to the preamble and that takes care of the automatic numbering with minimal fuss. (Although it doesn't solve the issue of in-text references I mention in my comment below (but not in my original post).) – Miztli Dec 3 '17 at 18:41
• If you use \refstepcounter instead of \stepcounter then you can use \labels inside the table and refer to them. – Alan Munn Dec 3 '17 at 19:12

Isn't it an option to write the a. by yourself?

    \begin{tabular}{|rl|c|c:c|}\hline
& /CaCiC/ & {\sc *Mid} & {\sc Ident}(hi) & {\sc *High} \\\hline
\asr[reptype=nots,xgap=2em,syB=-2em,phB=0em] CaCeC|
\@(0.5,1n){[+lo]}


and an automatic solution:

[...]
\newcounter{tabcounter}
\let\Tabular\tabular
\renewcommand\tabular{\setcounter{tabcounter}{0}\Tabular}
\let\MC\multicolumn

\begin{document}
\begin{exe}
\ex \textit{\emph{/CaCiC/} input; e.g. \emph{kwazis-} greet'}\\
\begin{tabular}{|r @{\stepcounter{tabcounter} \alph{tabcounter}. }l|c|c:c|}\hline
\MC{1}{|c}{}    & /CaCiC/ & {\scshape *Mid} & {\scshape Ident}(hi) &
{\scshape *High} \\\hline
[...]


• Yes, and that's what I've been doing so far, but I'd rather it be automated. Plus, if I do that, I'd also have to manually add and update in-text references to specific rows in the table which I would also like to avoid. – Miztli Dec 3 '17 at 17:50
• see edited answer – user2478 Dec 3 '17 at 19:52