# feature matrices in pst-asr

I need feature matrices within my pst-asr phonological structure. The manual, p.15, proposes the following macro:

\def\\#1#2{$\left[\matrix {\rm #1cons\hfill\cr \rm#2sonor\cr}\right]$}


However, I can't make it work. Here is my MWE:

\documentclass{amsart}

\usepackage{pst-asr}
\def\feat#1{$\rm [#1]$}
\def\\#1#2{$\left[\matrix{\rm #1cons\hfill\cr \rm#2son\cr}\right]$}
\tiershortcuts

\begin{document}

\newtier{obstr}
\psset{xgap=1.5in, yunit=2em, phB=-1, ts=0 (Pg),
obstr=-1 ([), tssym=$\times$}
\DefList{\cont{-0.5}, \obstr{0}, \cons{1}, \voi{1}}

\asr \X |
\@(\obstr,obstr){\\+-}
\-(0,ts)
\endasr

\end{document}


Changing the \documentclass from amsart to article would make it work, but I was interested to ask if anybody knows the reason why amsart does not like matrices, and if there is a solution for it.

• i'm not in a position to test this now (i can do that tomorrow, when i'm at a real computer), but i suspect two reasons: (1) amsmath has defined a number of matrix structures as environments, so \matrix has been effectively disabled, and (2) redefining \\  is not a great idea when it is so heavily used by amsmath to split lines of multi-line displays. since amsmath is automatically loaded by amsart, this makes for a very shaky situation. – barbara beeton Feb 2 '17 at 1:01
• Interesting. I also tried to use \begin{matrix} ... \end{matrix} instead of \matrix{ }, but it won't work either. – RobertP. Feb 2 '17 at 5:03

the reason this doesn't work with amsart is mainly because amsart automatically loads amsmath, which redefines \matrix as an environment. (several environments, actually.) also, redefining \\ which is used for many things related to starting a new line isn't a good idea.

but the following reformulation seems to work -- it produces output identical to that when article is used -- although the version of tex live (2016) i have available has a problem when running pdflatex. (it finds that \c@lor@to@ps is an undefined control sequence. but that's a different kettle of fish, and should be reported as something that needs updating. all works just fine with "ordinary" latex-to-dvi.)

there is certainly a better choice of name than \9 for what i chose to replace \\ but that's up to you. since amsart has a matrix environment that already includes properly sized brackets, i used that instead of the \left[ ... \right] formulation.

\documentclass{amsart}

\usepackage{pst-asr}
\def\feat#1{$\rm [#1]$}
%\def\\#1#2{$\left[\matrix{\rm #1cons\hfill\cr \rm#2son\cr}\right]$}
\def\9#1#2{$\begin{bmatrix} \mathrm{#1cons}\\ \mathrm{#2son} \end{bmatrix}$}
\tiershortcuts

\begin{document}

\newtier{obstr}
\psset{xgap=1.5in, yunit=2em, phB=-1, ts=0 (Pg),
obstr=-1 ([), tssym=$\times$}
\DefList{\cont{-0.5}, \obstr{0}, \cons{1}, \voi{1}}

\asr \X |
% \@(\obstr,obstr){\\+-}
\@(\obstr,obstr){\9+-}
\-(0,ts)
\endasr

\end{document}