\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}
}

\end{document}

-
Excellent answer. Thanks egreg. I found that your solution using \raisebox and \tstrut almost worked perfectly for me. In my actual document, I'm using Charis SIL font (maybe that's a crucial difference?). Anyway, for me, bottom of the words 'grammatical morphemes' were at the midline of the example number, rather than the bottom. I can add '+1ex' to the end of the height and that gets me close. Perhaps I should try the adjustbox solution you also posted. –  apexofservice Dec 7 '12 at 23:38
@apexofservice Please, have a look at the site FAQ (you find the link at the top of the page), particularly tex.stackexchange.com/faq#reputation –  egreg Dec 7 '12 at 23:40
okay, I've read that. What was I missing or doing wrong? –  apexofservice Dec 7 '12 at 23:42
@apexofservice Nothing wrong. But voting for helpful answers is an important aspect of the StackExchange network; it gives a measure of what answers are better and also helps in searches. For instance, I upvoted your question, because it's interesting and has all that's needed for understanding and analyzing the problem. I'm not pledging for your vote, just trying to explain how the site works. –  egreg Dec 7 '12 at 23:46
got it. I would have upvoted your answer but my reputation is in fact too low to have that privilege. I was able to 'accept' though. –  apexofservice Dec 7 '12 at 23:48
show 1 more comment