4

i was looking arround here for this style of Categorial Grammar (see picture). However, i just find another types of notation, like the Prawtiz's style derivation. I want this style (some people call it Steedman sytle). If you can help with the package I must use and doing as example this derivation, i'll appreciate it.

Getzen style

Thanks

  • 1
    I think the best source for styles for this are Jason Baldridge's styles which can be found here on GitHub: https://github.com/jasonbaldridge/cg-latex – Alan Munn Jul 09 '16 at 02:18
  • 1
    If you find the styles useful then I would recommend making a small sample document with them and posting it and the link as an answer to your own question. This way if others come across your question it will have an accepted answer. – Alan Munn Jul 09 '16 at 02:57

3 Answers3

1

This can obviously use a bit of improvement in terms of fine tuning horizontal placement, but I mainly present it to highlight some new capability of tabstackengine 2018/03/05 (V2.10) uploaded this past Monday, with \TABrules and \TABcline{}.

\documentclass{article}
\usepackage[TABcline]{tabstackengine}
\usepackage{xcolor}
\def\tbs{\,\textbackslash}
\makeatletter
\newcommand\RR{%
  \rlap{\kern.5\dimexpr\tabbed@gap\relax\llap{\fboxsep=0pt\colorbox{white}{$>$}}}}
\newcommand\LL{%
  \rlap{\kern.5\dimexpr\tabbed@gap\relax\llap{\fboxsep=0pt\colorbox{white}{$<$}}}}
\makeatother
\setlength\TABruleshift{\dimexpr.5\ht\strutbox-.5\dp\strutbox}
\setstacktabbedgap{1ex}
\TABstackTextstyle{\itshape}
\setstackgap{S}{2pt}
\begin{document}
\bgroup
\catcode`!=\active \def!{\upshape}
\catcode`?=\active \def?#1{\makebox[0pt]{#1}}
\tabbedShortstack{
!Female &        &!astronaut &  & !sets        &        & !new   &        & !record   &\\
\TABcline{1,3,5,7,9}
N/N     &        & N         &  &{!(}S\tbs NP\/{!)}/NP& & N/N    &        & N         &\\
\TABrule&\TABrule&\TABrule\RR&  &              &        &\TABrule&\TABrule&\TABrule\RR&\\
        &?N      &           &  &              &        &        &?N      &           &\\
\TABcline{1-3,7-9}
        &?{NP}   &           &  &              &        &        &?{NP}   &           &\\
        &        &           &  &\TABrule      &\TABrule&\TABrule&\TABrule&\TABrule\RR&\\
        &        &           &  &              &?{S\tbs NP}&     &        &           &\\
\TABrule&\TABrule&\TABrule   &\TABrule&\TABrule&\TABrule&\TABrule&\TABrule\LL&        &\\
        &        &           &?S&              &        &        &        &           &
}
\egroup
\end{document}

enter image description here

1

I was recently in need of this style of notation as well. To make it easier for others to get started using it, I am just combining the comment of Alan Munn and the answer by yannis.

Indeed the best way to produce derivations of the Steedman style is to use the .sty files provided by github.com/jasonbaldridge/cg-latex. Simply copy them into your working directory, and then use this MWE:

\documentclass{article}
\usepackage{ccg}
\usepackage{amstext}

\begin{document}

\deriv{5} { \text{Female} & \text{astronaut} & \text{sets} & \text{new} & \text{record} \ \uline{1} & \uline{1} & \uline{1} & \uline{1} & \uline{1} \ \text{N/N} & \text{N} & \text{(S\bs NP)/NP} & \text{N/N} & \text{N} \ \fapply{2} & & \fapply{2} \ \mc{2}{\text{N}} & & \mc{2}{\text{N}} \ \uline{2} & & \uline{2} \ \mc{2}{\text{NP}} & & \mc{2}{\text{NP}} \ & & \fapply{3} \ & & \mc{3}{\text{S\bs NP}} \ \bapply{4} & \ \mc{4}{\text{S}} & \ }

\end{document}

Which produces: Combinatory Categorial Grammar example

For the documentation you can refer to the Readme in the repository or, much easier, the manual by yannis which has since moved to here.

0

I wrote a draft of CCG style manual. It only covers categorial grammar derivations but it may spare some time to potential users. The PDF is here

yannis
  • 2,013
  • 19
  • 18