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{h}{\textit{head}}&&\rnode{d}{dependent}\\
&&\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{h}{\textit{head}}&&\rnode{d}{dependent}\\
&&\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.
Best Answer
One might think of using
\adjustbox
from theadjustbox
package, but it turns out that this package is not compatible withpstricks
because they both define\clipbox
. A workaround is to emulate what the package does in the case we need: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 withpstricks
; the macro\clipbox
ofadjustbox
(which is not necessary here) becomes\adjclipbox
.