Skip to content

latex style file for drawing Combinatory Categorial Grammar (CCG) derivations

License

Notifications You must be signed in to change notification settings

bozsahin/ccg-latex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccg-latex

The commands in the ccg-latex.sty file can be used to typeset Combinatory Categorial Grammar (CCG) derivations in latex.

The example file shows how.

The basic command is \begin{ccg}{n}{data}{derivs}\end{ccg}.

It typesets CCG derivations, in n columns of data, possibly multilined with \\, and derivations (derivs), each line separated by \\, without glosses.

It has a variant, \begin{ccgg}{n}{data}{gloss}{derivs}\end{ccgg}, which typesets glosses before the top lines are drawn.

Both are based on \cgex{n}{derivs}, which is kept for legacy code, where n is the number of columns, and derivs is the double-backslash-separated lines of at most that many columns.

\cglines{n} typesets n undecorated lines separated by blanks, which is common practice after lexical assumptions. These are entered by default in {ccg} and {ccgg} environments above.

Basic commands other than above (see the style file for a full list):

\cgf{..} typesets the syntactic category.

\cat{..} typesets the syntactic category. It is an alias of \cgf{..}.

\lf{..} typesets the logical form, including the colon and math mode.

\fs is the forward slash. We also have \bs, \us, \fss, \bss as backslash, undirectional slash, double forward slash and backward, etc.

Use \fs and \bs consistently, rather than '/' for forward slash and say \bs for backslash, for consistent same-font rendering of the syntactic types.

Some of these slashes have aliases. \fss, \bss, \uss are resp. \rds, \lds, \uds.

\combx typesets the combinator x in bold Curry and Feys notation.

\cgs{cat}{features} typesets category cat subscripting the features.

For example NPacc is \cgs{NP}{acc}. VPfin=+,agr=3s is \cgs{VP}{fin=+,agr=3s}.

\cgss{cat}{feat1}{feat2} typesets category cat subscripting feat1 and superscripting feat2.

For example, NPacce is \cgss{NP}{acc}{e}. (Actually, it is rendered better than markdown, because 'e' and 'acc' will be vertically aligned.)

\cgline{n}{rulename} draws a CCG line across n columns, and indexes it with the rule.

Rule names are \cgfa, \cgba, \cgfc, \cgbc etc. Rulename need not be a pre-defined rule name.

\cgres{n}{..} typesets the CG result in the material .. across n columns. The ... is typeset as \cgf{...}. If there is math mode in it, that is typeset in math mode.

\badline{n}{rulename} typesets a line spanning n columns with *** in the middle, with rule name at the end.

\mc{n}{text} typesets the text multi-column centered over n columns; useful for foreign language glossing.

\fstars is a forward slash with star modality, i.e. /*.

\bxs is a backward slash with crossing modality, i.e. \x.

Defined for all slashes and modalities.

enjoy.

-cem bozsahin

About

latex style file for drawing Combinatory Categorial Grammar (CCG) derivations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages