Phrase structure rules
Phrase structure rules for use with LFG for example, can be created by defining the new commands given below, as originally given in an introduction to LaTeX for computational linguistics students.
%% LFG
\newcommand{\symb}[2]{%
\begin{tabular}{c}
\normalsize{#1}\\
\footnotesize{#2}
\end{tabular}}
% Optional rule support
\newcommand{\opt}[1]{\ensuremath{\left(#1\right)}}
% Macros
\newcommand{\rarr}{\ensuremath{\rightarrow}}
\newcommand{\uarr}{\ensuremath{\uparrow}}
\newcommand{\darr}{\ensuremath{\downarrow}}
\newcommand{\blank}{\ensuremath{\quad}}
You can use these commands as given in the following example to obtain the illustrated LFG rule, which is a screenshot from the original page.
\symb{VP}{} \blank
\symb{\to}{} \blank
\symb{V}{\ua=\da} \blank
\opt{\symb{NP}{(\ua OBJ)=\da}}
I’ve only used them for LFG, but I’m sure you could use them without the arrows and whatnot to get the functionality to replace that in covington, once you stop using that. The mark-up might look like a nightmare at first, but it’s not really any worse than similar LaTeX stuff.
tags: computing, latex, top tips
last modified: 20th Feb 2012



