# qtree - reduce spacing between lines in multiline node label with avm

I'm trying to build a syntax tree in qtree, which has AVMs with their category above as nodes. The way I tried to do this is by using a multiline node label, with the category on the first line and the AVM on the second. The output, however, has more spacing than I'd like between the first and second lines, seen here:

The issue is the amount of space between S and the AVM below, NP and the AVM below, and the N and the AVM below. How can I reduce the space between these elements?

Following is the code I used to achieve the tree pictured above. I tried reducing the spacing of the AVM but it didn't resolve the issue.

\documentclass[a4paper, 11pt]{article}
\usepackage{qtree}
\usepackage{avm}
\avmvskip{.1ex}\avmhskip{.5em} % reduce spacing in avms

\begin{document}

\Tree[.S\\\begin{avm}$HEAD&\[AGR&\[PER&3rd\\NUM&sg$\]\]\end{avm}
[.NP\\\begin{avm}$HEAD&\[AGR$\]\end{avm}
[.N\\\begin{avm}$HEAD$\end{avm} Alex ] ] ]

\end{document}

[.NP\\\begin{avm}$HEAD&\[AGR$\]\end{avm}
[.N\\\begin{avm}$HEAD$\end{avm} Alex
]
]
]
\end{document}


# EDIT

For example, here are three Forest versions. The first uses the default spacing. The second and third use a custom style, avm in different ways.

While the second just modifies the spacing, the third does away with the need to use the avm environment in every node by treating any content following a colon as material to wrap in that environment.

I'm not familiar with avm and don't have time to look into the details right now so the spacing is not quite right in terms of the sizes of the square brackets. If anybody knows how to correct this, please let me know! (Or post an answer, of course.)

\documentclass[border=10pt]{standalone}
\usepackage[linguistics]{forest}
\usepackage{avm,array}
\avmvskip{.1ex}\avmhskip{.5em}
\forestset{%
avm/.style={%
TeX={\setlength\extrarowheight{-10pt}},
before typesetting nodes={%
for tree={%
split option={content}{:}{content,make avm},
},
},
},
make avm/.style={%
content+={%
\\\begin{avm}#1\end{avm}
},
},
}
\begin{document}
\begin{forest}
[S\\\begin{avm}$HEAD&\[AGR&\[PER&3rd\\NUM&sg$\]\]\end{avm}
[NP\\\begin{avm}$HEAD&\[AGR$\]\end{avm}
[N\\\begin{avm}$HEAD$\end{avm}
[Alex
]
]
]
]
\end{forest}
\begin{forest}
avm
[S\\\begin{avm}$HEAD&\[AGR&\[PER&3rd\\NUM&sg$\]\]\end{avm}
[NP\\\begin{avm}$HEAD&\[AGR$\]\end{avm}
[N\\\begin{avm}$HEAD$\end{avm}
[Alex
]
]
]
]
\end{forest}
\begin{forest}
avm
[S:$HEAD&\[AGR&\[PER&3rd\\NUM&sg$\]\]
[NP:$HEAD&\[AGR$\]
[N:$HEAD$
[Alex
]
]
]
]
\end{forest}
\end{document}


Here's a comparison of the output:

• This is fantastic, thank you so much! I think I will make the switch over to forest after seeing how simple it is. Also I'm not sure what you mean about the spacing with the square brackets in the AVMs--it looks good to me! Oct 8 '16 at 2:31