AVMs in LaTeX
[ LaTeX for Linguists, .dvi, .ps, .pdf]

## Andrew Bredenkamp

• Using avm.sty
• Large avms
• Other packages
• The package

• Most people use Chris Manning's avm.sty for producing sorted and unsorted attribute-value matrices.

(If you just want to make a single avm, you could just use a LaTeX array environment (see below), but avm.sty is very simple, and much easier).

As with other packages, you can load avm.sty with the following line in the preamble (before the \begin{document}):

\usepackage{avm}


There are a number of options for avm.sty which can be set in the preamble, these define the type of avm you want and the fonts for values, sorts, etc. All examples given below assume that the following options are set:

\avmfont{\sc}
\avmoptions{sorted,active}
\avmvalfont{\rm}
\avmsortfont{\scriptsize\it}


# Using avm.sty

Using avm.sty in active/sorted' mode allows avms for typed feature structures' to be constructed quickly and clearly.

Here is an example:

\begin{avm}
dtrs  [{hd-str}
\end{avm}


The position of the sort label can be changed (see the full documentation).

It is very easy to get other sorts of bracket (again, see the full documentation).

Untyped avms of the kind used in LFG functional descriptions can be created in the same way (just give an empty sort):

\begin{avm}
[{}  pred  & likes< \_ , \_ >'     \\
tense &  pres                \\
subj  &  [{} pred & Fido']  \\
obj   &  [{} pred & bones']]
\end{avm}

If you only ever produce avms without the sort, you can turn off the sorted' option, and so not write the empty {}' that was used above (again, see the full documentation).

The advantage of using the active' option is that the commands for doing things like drawing the square brackets do not need a backslash' in front of them. The disadvantage is that this means you cannot define a command to draw an avm (e.g. to draw the same avm twice). If you want to do this (and it is a very useful thing to do, especially when making large avms (a) because they can be difficult for LaTeX, and (b) because they can be difficult for you -- it is easier to avoid mistakes if you make your avms in small pieces separately, and then just combine the pieces together), you need the inactive' option. We look at this in the next section.

# Large avms

Due to a limitation on LaTeX, large avms can cause problems (you might get errors referring to semantic nest size. To get round this, you have to build complex avms by nesting smaller ones (it is also easier to avoid mistakes if you do things like this). The best way to do this is by defining and using boxes':

\newbox\matrixsynsem \newbox\headdtr
\newbox\compdtrone   \newbox\compdtrtwo

{\scriptsize
\avmoptions{center}
\setbox\matrixsynsem=\hbox{\begin{avm}
\osort{synsem}{$local & \[cat & \[$ \\
content & \]\]}
\end{avm}}

\osort{word}{$phon\;\<\rm likes\>\\ synsem\;\[local\[ cat\;\[ head \; \@{5}\\ arg-s\;\< \@{1},\@{2}\>$ \\
content\;\@{6} \]\]\]} \end{avm}}

\setbox\compdtrone=\hbox{\begin{avm}
\sort{phrase}{$phon\;\<\rm fido\>\\ synsem\;\@{1}\;\[local\[ cat\;\[ head\;noun\\ arg-s\;\< \>$ \\
content\;\@{3} \]\]\]} \end{avm}}

\setbox\compdtrtwo=\hbox{\begin{avm}
\sort{phrase}{$phon\;\<\rm bones\>\\ synsem\;\@{2}\;\[local\[ cat\;\[ head\;noun\\ arg-s\;\< \>$ \\
content\;\@{4} \]\]\]} \end{avm}}

\avmoptions{active,sorted}
\begin{avm} \hspace{-1in}
[{phrase} phon\;\<\rm fido likes bones\> \\
synsem\;[{synsem} local [{} cat & [{} head & @{5}\\
arg-s & \< \; \>] \\
content & @{6}[{psoa} reln\;like \\
arg1\;@{3} \\
arg2\;@{4} ]]]\\
comp-dtrs\;< \box\compdtrone , \\ \hspace{.5in}
\box\compdtrtwo>]}]
\end{avm}}


produces:

It is possible to draw curves between points inside an avm by using tree-dvips.sty:

\begin{avm}
[{} pred & liet<($\uparrow$ subj)($\uparrow$ obj)($\uparrow$ xcomp)>' \\
subj & Marie' \\
obj  & \node{uobj}{Jan'} \\
xcomp & [{} pred & bouwen' \\
subj & \node{dsubj}{  '}  \\
obj  & een huis' \\
obl_{voor} & [{} pred &voor' \\
obj  & zich' ]]]
\end{avm}
\nodecurve[r]{uobj}[r]{dsubj}{2in}


will produce:

You can combine trees with avms using features from tree-dvips.sty:

This was generated by the following code:

\begin{small}
\vbox{
\begin{tabular}{cccc}
`

# The package

The package is available here in the following bundles:

Last real modification: July 10, 1997