Attribute Value Matrices
This article demonstrates typesetting attribute value matrices (AVMs), which are a practical way to present feature structures as a group of attributes and their corresponding values.
Advisory notes on AVM packages for LaTeX
This article uses the avm
package, which was the preferred opinion for typesetting AVMs at the time this material was initially written. Unfortunately, the avm
package is not distributed by TeX Live, meaning Overleaf users will have to upload a copy (avm.sty
) into their projects. To address this, the Overleaf Gallery project that accompanies this article includes a copy of the avm
package.
An alternative to avm
, the langsci-avm
package, is now available in TeX Live, making it directly accessible via Overleaf. However, due to syntax and feature differences, the avm
-based examples in this article will not compile with langsci-avm
and require some editing. See section 4.6 of the langsci-avm
documentation for guidance on migrating from avm
to langsci-avm
.
Getting started
Use the avm
environment to create an attribute value matrix, as demonstrated in the following example:
\documentclass{article}
\usepackage{avm}
\begin{document}
\begin{avm}
\[ cat\|subcat & \<NP$_{it}$, NP$_{\@2}$, S[comp]:\@3\> \\
content & \[ relation & \bf bother\\
bothered & \@2 \\
soa-arg & \@3 \] \]
\end{avm}
\end{document}
This example produce the following output:
* To explore AVMs, open this Overleaf project.
Basic usage
To typeset an attribute value matrix inside an avm
environment there are a number of commands you need to know:
\avmfont{\sc}
: changes the font used in the matrices, in this case to small caps. Any other font family will work. The font size and font typeface can also be declared here.\begin{avm}
and\end{avm}
: these open and close the environment where the attribute value matrix will be created.\[
and\]
: print the squared brackets that delimit parts of the matrix. Other brackets can also be used with the commands\<
,\>
,\{
and\}
.\\
: inserts a new line.&
: creates a column division within the same line.
The following example demonstrates these:
\documentclass{article}
\usepackage{avm}
\avmfont{\sc}
\begin{document}
\begin{avm}
\[ subj & \[ pers & 3 \\
num & sg \\
gend & masc\\
pred & \rm ‘pro’ \]\\
pred & \rm ‘eat\q<SUBJ, OBJ\q>’\\
obj & \[ pers & 3 \\
num & pl \\
gend & fem \\
pred & \rm ‘pro’ \]
\]
\end{avm}
\end{document}
This example produces the following output:
* To explore AVMs, open this Overleaf project.
Unaligned columns
Sometimes, when a row is too long, it may be convenient to use unaligned columns to improve output:
\begin{avm}
\[ \avmspan{system\|local\|content\; \@2} \\
qstore & \[det & \textnormal{forall} \\
restpar & \@2 \[para & \@1 \\
restr & \[reln & \textnormal{book} \\
inst & \@1 \] \] \] \]
\end{avm}
This example produces the following output:
The command \avmspan{}
prevents column alignment for its argument, whilst the command \;
inserts a horizontal blank space slightly longer than normal, creating a nice separator.
* To explore AVMs, open this Overleaf project.
Sort labels
It is possible to add sort labels at the corners of a AVM. There are two possible styles. The first one is printing the labels inside the matrix:
\avmsortfont{\it}
\avmvalfont{\it}
\begin{avm}
\[ \asort{indexed-obj}
index & \[\asort{index}
variable & \@1 \[\asort{variable}
per & 3rd \\
num & sing \\
gend & neut \] \\
restriction & \[\asort{psoa}
relation & book \\
instance & \@1 \] \] \]
\end{avm}
This code produces the following output:
* To explore AVMs, open this Overleaf project.
There are three new commands in this example:
\avmsortfont{\it}
: sets the font type for the sort keys, italics in this case but other font styles and sizes can be used\avmvalfont{\it}
: sets the font type for the values in the AVM, italics in this case.\asort{key}
: prints the sortkey
.
It's also possible to overlap the sort label onto the previous column, as shown in the next example:
\avmvalfont{\it}
\avmsortfont{\it}
\begin{avm}
\sort{indexed-obj}{\[ index & \osort{index}{\[
variable & \@1 \osort{variable}{\[ per & 3rd \\
num & sing \\
gend & neut \]} \\
restriction & \osort{psoa}{\[relation & book \\
instance & \@1 \]} \]} \]}
\end{avm}
This example produces the following output:
* To explore AVMs, open this Overleaf project.
There are two new commands:
\sort{label}
: prints thelabel
, taking up space in the column where it appears.\osort{label}
: overlaps the label without checking collisions or available space.
Reference guide
Available brackets in the avm package.
Command | Output |
---|---|
\{ \} |
|
\[ \] |
|
\< \> |
Further reading
For more information see
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class