LSA & LaTeX

Logo

A somewhat comprehensive treatment of LaTeX for the purposes of linguistics and LSA in particular. Also, info on (some) LSA templates.

Compiled examples are here.


A note on LFG and HPSG (not GPSG really, though)

It is not good to discriminate against less-common syntactic theories by including only information about mainstream Chomsky-style generative trees. There is no doubt, however, that LFG and HPSG both use very cumbersome notation. This is perhaps clear even from the look of the matrices which are usually involved. The purpose of this page is not to explain the package used for LFG-style matrices, but just give an example. I’ll give two examples: one of a structure generated by a package created to fit the specific needs of LFG-like structures, and then I’ll also give an example of my rough approximation of that structure using basic LaTeX (in fact, only bmatrix from amsmath).

AVM .sty

AVMS is a style document developed specifically for LFG-like structures. Example of its use and more information can be found here. Importantly, it cannot be loaded just by calling a package in he preamble. A file called avm.sty (available on the website following the links above) needs to be uploaded to the folder with the main .tex file before the package can be called.

So, here’s an example of an LFG structure (including the preamble):

% part of the preamble (does not include documentclass, and won't include begin-document below)
\usepackage{avm}
\avmfont{\sc}
\avmoptions{sorted,active}
\avmvalfont{\rm}
\avmsortfont{\scriptsize\it}

% again, example from https://www1.essex.ac.uk/linguistics/external/clmt/latex4ling/avms/;
% the .sty document can be found therein as well
\newbox\matrixsynsem \newbox\headdtr
\newbox\compdtrone   \newbox\compdtrtwo
{\scriptsize
\avmoptions{center}
\setbox\matrixsynsem=\hbox{\begin{avm}
\osort{synsem}{\[local & \[cat & \[ \] \\
                    content & \[ \]\]\]}
\end{avm}}

\setbox\headdtr=\hbox{\begin{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} ]]]\\
       dtrs\;\sort{head-struc}{[{} head-dtr\;\box\headdtr \\
                  comp-dtrs\;< \box\compdtrone , \\ \hspace{.5in}
                                            \box\compdtrtwo>]}]
\end{avm}}

This is rather involved, but structure is traceable and can be grasped to some extent intuitively. The package is indeed vital, because the structures like this are difficult and very unappealing when attempted in simple LaTeX. My attempt at an approximation of this is below, and it is rather unprepossessing. Further, it is an approximation and does not reflect the intended LFG structure very well. Closer approximations would come with more complexity.

% requires \usepackage{amsmath}
\centering
\tiny
\[
\textit{phrase}
\begin{bmatrix}
\begin{matrix}
${\sc phon}$ & \langle \text{fido likes bones}\rangle \\
${\sc synsem}$ & \textit{synsem}\begin{bmatrix}
${\sc local}$ &
\begin{bmatrix}
${\sc cat}$ & \begin{bmatrix}
${\sc head}$ & [5] \\
${\sc arg-s}$ & \langle \rangle
\end{bmatrix}
\\
${\sc content}$ & \textit{psoa} \begin{matrix}
[6] & \begin{bmatrix}
${\sc reln}$ & ${\sc like}$\\
${\sc arg1}$ & [3]\\
${\sc arg2}$ & [4]
\end{bmatrix}
\end{matrix}
\end{bmatrix}
\end{bmatrix}
\end{matrix} & \\
${\sc dtrs}$
&
\textit{head-struc} \begin{bmatrix}
${\sc head-dtr}$ &
\begin{bmatrix}
${\sc head-drt}$ &
word \begin{bmatrix}
${\sc phon}$ & \langle \text{likes} \rangle \\
${\sc synsem}$ &
\begin{bmatrix}
${\sc local}$ & \begin{bmatrix}
${\sc cat}$ &
\begin{bmatrix}
${\sc head}$ & [5]\\
${\sc arg-s}$ & \langle [1][2] \rangle
\end{bmatrix}\\
${\c content}$ & [6]
\end{bmatrix}
\end{bmatrix}
\end{bmatrix}
\end{bmatrix}\\
${\sc compt-dtr}$ &
\left\langle
\begin{matrix}
phrase \begin{bmatrix}
${\sc phon}$ & \langle \text{fido} \rangle & \\
${\sc synsem}$ & [1] & \begin{bmatrix}
${\sc local}$ & \begin{bmatrix}
${\sc cat}$ & {
\begin{bmatrix}
${\sc head}$ & ${\sc noun}$\\
${\sc arg-s}$ & \langle\rangle
\end{bmatrix}
} \\
${\sc content}$ & $[3]$
\end{bmatrix}
\end{bmatrix}
\end{bmatrix} %&
\\
% &
phrase \begin{bmatrix}
${\sc phon}$ & \langle \text{bones} \rangle & \\
${\sc synsem}$ & [2] & \begin{bmatrix}
${\sc local}$ & \begin{bmatrix}
${\sc cat}$ & {
phrase
\begin{bmatrix}
${\sc head}$ & ${\sc noun}$\\
${\sc arg-s}$ & \langle\rangle
\end{bmatrix}
} \\
${\sc content}$ & $[4]$
\end{bmatrix}
\end{bmatrix}
\end{bmatrix}
\end{matrix}
\right\rangle
\end{bmatrix}
\end{bmatrix}
\]

The intention is that this page also include some sort of example for (some variant of) relational grammar (APG most likely).


Compiled examples are here.

back