# \psmatrix baseline

I'm using lingmacros' \enumsentence with a \psmatrix inside.

\enumsentence{
\psset{linewidth=.5pt}
\begin{psmatrix}[rowsep=.2cm,nodesep=.05cm,colsep=.1cm]
&\rnode{gm}{grammatical morphemes}\\
\rnode{m}{\textit{bound}}&&\rnode{s}{free}\\
&&\rnode{c}{\textit{complement}}&&\rnode{mod}{\textit{modifier}}
\ncline{gm}{m}\ncline{gm}{s}
\ncline{s}{h}\ncline{s}{d}
\ncline{d}{c}\ncline{d}{mod}
\end{psmatrix}
}


This results in the example number aligned with the bottom of the psmatrix. I'd like it to align with the top. Normally, I think, minipage is used for this sort of thing. However, it seems that minipage isn't helping in this context (I'm flummoxed as to why.)

I found a thread with what seems to be a similar question here. But I don't see an answer given.

Any ideas?

edit: in reply to a comment, I'm adding a minimal working example:

\documentclass{article}
\usepackage{pstricks,pst-node}
\usepackage{lingmacros}
\begin{document}

\enumsentence{
\psset{linewidth=.5pt}
\begin{psmatrix}[rowsep=.2cm,nodesep=.05cm,colsep=.1cm]
&\rnode{gm}{grammatical morphemes}\\
\rnode{m}{\textit{bound}}&&\rnode{s}{free}\\
&&\rnode{c}{\textit{complement}}&&\rnode{mod}{\textit{modifier}}
\ncline{gm}{m}\ncline{gm}{s}
\ncline{s}{h}\ncline{s}{d}
\ncline{d}{c}\ncline{d}{mod}
\end{psmatrix}
}

\end{document}


The above code compiles but produces the example number aligned with the baseline of the psmatrix as described above.

-
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  egreg Dec 7 '12 at 22:18

One might think of using \adjustbox from the adjustbox package, but it turns out that this package is not compatible with pstricks because they both define \clipbox. A workaround is to emulate what the package does in the case we need:

\documentclass{article}
\usepackage{pstricks,pst-node}
\usepackage{lingmacros}
\newcommand{\tstrut}{\vrule width 0pt height\ht\strutbox depth 0pt}
\begin{document}

\enumsentence{\raisebox{\dimexpr-\height+\ht\strutbox}{%
\psset{linewidth=.5pt}
\begin{psmatrix}[rowsep=.2cm,nodesep=.05cm,colsep=.1cm]
&\rnode{gm}{\tstrut grammatical morphemes}\\
\rnode{m}{\textit{bound}}&&\rnode{s}{free}\\
&&\rnode{c}{\textit{complement}}&&\rnode{mod}{\textit{modifier}}
\ncline{gm}{m}\ncline{gm}{s}
\ncline{s}{h}\ncline{s}{d}
\ncline{d}{c}\ncline{d}{mod}
\end{psmatrix}}%
}

\end{document}


The trick is to lower the psmatrix by its height minus the height of the standard strut. However, the first line in the matrix must be made as high as the strut (but not as deep under the baseline or the lines would be clipped), so I define a "top strut".

Alternatively, you can load adjustbox, but with a trick for making it compatible with pstricks; the macro \clipbox of adjustbox (which is not necessary here) becomes \adjclipbox.

\documentclass{article}
\usepackage{pstricks,pst-node}

\let\pstricksclipbox\clipbox
\let\clipbox\relax

\let\clipbox\pstricksclipbox
%%% end

\usepackage{lingmacros}

\begin{document}

\psset{linewidth=.5pt}
\begin{psmatrix}[rowsep=.2cm,nodesep=.05cm,colsep=.1cm]
&\rnode{gm}{grammatical morphemes}\\
\rnode{m}{\textit{bound}}&&\rnode{s}{free}\\
&&\rnode{c}{\textit{complement}}&&\rnode{mod}{\textit{modifier}}
\ncline{gm}{m}\ncline{gm}{s}
\ncline{s}{h}\ncline{s}{d}
\ncline{d}{c}\ncline{d}{mod}
\end{psmatrix}