-
Notifications
You must be signed in to change notification settings - Fork 0
/
LI.sty
210 lines (176 loc) · 8.88 KB
/
LI.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% CCG stuff originally by B. Hoffman, modified by mjs
%frig \mathbf for combinators to sans:
\DeclareMathAlphabet{\mathbf}{OT1}{cmss}{bx}{n}
%%%\newcommand{\bs}{\backslash}
\newcommand{\Tc}{{\mathbf T}}
\newcommand{\Bc}{{\mathbf B}}
\newcommand{\Sc}{{\mathbf S}}
\newcommand{\bu}{\%}%{\S}%{\letterspace to 0.82\naturalwidth{\%\%}}
\newcommand{\mathasterisk}{\raisebox{0pt}{*}}%an asterisk raised as in
%textmode for mathmode
%frig \mathbf for combinators to sans:
\DeclareMathAlphabet{\mathbf}{OT1}{cmss}{bx}{n}
%somehow does #1 many c's
% CCG derivations
% arguments: #1 = no. of words, #2 = body
\newcommand{\deriv}[2]
{ %\arraycolsep=.25em
\renewcommand{\arraystretch}{.5}
$\begin{array}[t]{@{}*{#1}{c@{~~}}}
#2
\end{array}$ }
% centered multicolumn,
\newcommand{\mc}[2]
{\multicolumn{#1}{c}{#2}}
%\newcommand{\less}{\\ \vspace{-.5ex}}
% Rules, argument #1 gives the number of columns to cover.
\newcommand{\uline}[1]
{\mc{#1}{\hrulefill} }
\newcommand{\fapply}[1]
{ \mc{#1}{\hrulefill_{>}} }
\newcommand{\bapply}[1]
{ \mc{#1}{\hrulefill_{<}} }
\newcommand{\fcomp}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{B}}}}
\newcommand{\fxcomp}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{B}_{\times}}}}
\newcommand{\fcomptwo}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{B}^2}}}
\newcommand{\fxcomptwo}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{B}_{\times}^2}}}
\newcommand{\fcompthree}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{B}^3}}}
\newcommand{\bcomp}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}}}}
\newcommand{\bxcomp}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}_{\times}}}}
\newcommand{\bcomptwo}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}^2}}}
\newcommand{\bxcomptwo}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}_{\times}^2}}}
\newcommand{\bcompthree}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}^3}}}
\newcommand{\bxcompthree}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{B}_{\times}^3}}}
\newcommand{\fsubst}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{S}}}}
\newcommand{\fxsubst}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{S}_{\times}}}}
\newcommand{\bxsubst}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{S}_{\times}}}}
\newcommand{\ftype}[1]
{ \mc{#1}{\hrulefill_{{>}\mathbf{T}}}}
\newcommand{\btype}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{T}}}}
\newcommand{\conj}[1]
{ \mc{#1}{\hrulefill_{{<}\Phi{>}}}}
\newcommand{\boundary}[1]
{ \mc{#1}{\hrulefill_{{<}\mathbf{\%}}}}
\newcommand{\asterisk}[1]
{ \mc{#1}{\hrulefill_{\mathbf{*}}}}
\newcommand{\comb}[2] % an arbitrary combinator
{ \mc{#1}{\hrulefill_{#2}}}
\newcommand{\dcomp}[2] % an arbitrary dcomposition
{ \mc{#1}{\dotfill_{#2}}}
\newcommand{\unfreeze}[1]
{\mc{#1}{\hrulefill_{\mathbf{@}}} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% stuff to allow stuff besides brackets in citation labels
%\makeatletter
%\newcommand{\citedelimiters}[2]{ %change opening and closing brackets
%\def\@cite##1##2{#1{##1\if@tempswa , ##2\fi}#2}
%\def\@biblabel##1{#1##1#2\hfill}
%}
%\makeatother
%\citedelimiters{}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Examples
%%Notice that the example envirnment shrinks tabcolsep
\newcounter{example}
\newlength{\labellength}
\newlength{\textlength}
%tried to change this to give less of a space at the beginning so
%works better for two-column acl format - SC
%\newenvironment{example}
%{\begin{list}{}{\setlength{\itemindent}{0em}\settowidth{\labelwidth}{(\theexample)}\setlength{\labelsep}{0.5em}\settowidth{\leftmargin}{(\theexample)\makebox[0.5em]{}}\setlength{\topsep}{5pt}\setlength{\partopsep}{0ex}}
%\refstepcounter{example}\setlength{\tabcolsep}{1pt}}{\end{list}}
\newcommand{\startx} %cg example
{\begin{example}\rm\settowidth{\labellength}{(\theexample)\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
\item[(\theexample)]\begin{minipage}[t]{\textlength}}
\newcommand{\startxl}[1] %labelled cg example
{\begin{example}\rm\settowidth{\labellength}{(\theexample)\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
\label{#1}
\item[(\theexample)]\begin{minipage}[t]{\textlength}}
\newcommand{\startpx} %paragraph example
{\begin{example}\rm\settowidth{\labellength}{(\theexample)\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
\item[(\theexample)]\begin{minipage}[t]{\textlength}}%{3.5in}}
\newcommand{\startpxl}[1] %labelled paragraph example
{\begin{example}\rm\settowidth{\labellength}{(\theexample)\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
\label{#1}
\item[(\theexample)]\begin{minipage}[t]{\textlength}}
\newcommand{\stopx} %end all numbered example
{\end{minipage}
\end{example}}
%\newcommand{\startfnx}[1] %cg example IN A FOOTNOTE--OBSOLETE BUGGY
% {\par\noindent #1\makebox[.5em]{}
% \setlength{\tabcolsep}{1pt}\settowidth{\labellength}{#1\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
% \begin{minipage}[t]{\textlength}}
%
%\newcommand{\stopfnx} %end example in footnote
% {\end{minipage}\\}
%
\newcounter{fnexample}
%\newenvironment{fnexample}
%{\begin{list}{}{\setlength{\itemindent}{0em}\settowidth{\labelwidth}{(\roman{fnexample})}\setlength{\labelsep}{0.5em}\settowidth{\leftmargin}{(\roman{fnexample})\makebox[0.5em]{}}\setlength{\topsep}{0pt}\setlength{\partopsep}{0ex}}
%\refstepcounter{fnexample}\setlength{\tabcolsep}{1pt}}{\end{list}}
\newcommand{\startfnx} %cg example IN A FOOTNOTE DOES NOT TAKE ARG #1
{\begin{fnexample}\rm\settowidth{\labellength}{(\roman{fnexample})\makebox[0.5em]{}}\setlength{\textlength}{\textwidth}\addtolength{\textlength}{-\labellength}
\item[(\roman{fnexample})]\begin{minipage}[t]{\textlength}}
\newcommand{\stopfnx} %end example in footnote/endnote
{\end{minipage}
\end{fnexample}}
\newcommand{\lefta}[1]{\stackrel{\leftarrow}{#1}}
\newcommand{\righta}[1]{\stackrel{\rightarrow}{#1}}
\newcommand{\exref}[2][\mbox{}]{(\ref{#2}#1)}
% the body of an example made up of several unlabelled items
\newenvironment{exlist}{\begin{list}{}{\setlength{\itemsep}{0ex}\setlength{\parsep}{\parskip}\setlength{\leftmargin}{0in}\setlength{\itemindent}{0ex}\setlength{\labelsep}{0em}\setlength{\labelwidth}{0em}\setlength{\topsep}{0ex}\setlength{\partopsep}{0ex}}}{\end{list}}
\newcounter{lexlistcounter}
% the body of an example made up of several LABELLED items
\newenvironment{lexlist}{\begin{list}{\alph{lexlistcounter}.}{\usecounter{lexlistcounter}\setlength{\itemsep}{0ex}\setlength{\parsep}{\parskip}\settowidth{\leftmargin}{\thelexlistcounter .\makebox[0.5em]{}}\setlength{\labelsep}{0.5em}
\setlength{\itemindent}{0em}\setlength{\topsep}{0ex}\setlength{\partopsep}{0ex}\setlength{\labelwidth}{1em}
}}{\end{list}}
\newcounter{nexlistcounter}
% the body of an example made up of several LEFT-JUSTIFIED ROMAN NUMBERED items
\newenvironment{nexlist}[1]{\begin{list}{\roman{nexlistcounter}.\hfill}{\usecounter{nexlistcounter}\setlength{\itemsep}{0ex}\setlength{\parsep}{\parskip}\settowidth{\labelwidth}{#1 .}\addtolength{\labelwidth}{0.25em}\setlength{\labelsep}{0.0em}
\setlength{\itemindent}{0em}\setlength{\topsep}{0ex}\setlength{\partopsep}{0ex}\setlength{\leftmargin}{\labelwidth}%\addtolength{\leftmargin}{0.5em}
}}{\end{list}}
%\newcounter{nexlistcounter}
%% the body of an example made up of several NUMBERED items
%\newenvironment{nexlist}{\begin{list}{\arabic{nexlistcounter}.}{\usecounter{nexlistcounter}\setlength{\itemsep}{0ex}\setlength{\parsep}{\parskip}\setlength{\leftmargin}{2em}\setlength{\labelsep}{1em}
%\setlength{\itemindent}{0em}\setlength{\topsep}{0ex}\setlength{\partopsep}{0ex}\setlength{\labelwidth}{2em}
%}}{\end{list}}
% for figures
% FIGURES
\newenvironment{myfigure}{\begin{figure}[t]}{\end{figure}}
\newcounter{myfigure}
\newcommand{\mycaption}[1]{\vskip
10pt\refstepcounter{myfigure}\begin{minipage}{\textwidth}{\bf
Figure \themyfigure \\} {\rm #1}\end{minipage}}
\newcommand{\ldb} % left double bracket math mode
{[ \makebox[.1em][r]{\raisebox{0ex}{$[$}}}
\newcommand{\rdb} % right double bracket math mode
{] \makebox[.1em][r]{\raisebox{0ex}{$]$}}}
% superscripts and subscripts *in text*
\newcommand{\textsup}[1]{\raisebox{.8ex}[0pt][0pt]{\scriptsize#1}}
\newcommand{\textsub}[1]{\raisebox{-.8ex}[0pt][0pt]{\scriptsize#1}}
% make an empty box the width of text #1
\newlength{\mystringwidth}
\newcommand{\makeboxtowidth}[1]{\settowidth{\mystringwidth}{#1}\makebox[\mystringwidth]{}}
\newcommand{\hangingpar}[4]{#1#3}%a dummy
%%%Stuff to hang a long example beneath things like *prefixes
\newlength{\funnylength}
\newlength{\hanginglength}
\newcommand{\myindent}[1]{\settowidth{\hanginglength}{#1}\makebox[\hanginglength]{}}%indents width of #1
\newcommand{\starindent}{\myindent{*}}%indents an asterisk worth
\newcommand{\hangmyindent}[2]{\setlength{\funnylength}{\linewidth}\settowidth{\hanginglength}{#1}\addtolength{\funnylength}{-\hanginglength}\parbox[t]{\funnylength}{#2}}%makes parbox right size