summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/sdrt/sdrt.sty
blob: 15bfb8a8069945ec0124ce7a1a693cdac5536635 (plain)
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                          %%
%% sdrt.sty v. 1.0 by Paul Isambert                                         %%
%% This set of macros is published under the LaTeX Project Public License.  %%
%%                                                                          %%
%% Comments, suggestions and bugs:                                          %%
%%                                                                          %%
%% zappathustra@free.fr                                                     %%
%%                                                                          %%
%% http://paulisambert.free.fr/                                             %%
%%                                                                          %%
%% Enjoy!                                                                   %%
%%                                                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sdrt}[2008/04/02 Package for typesetting Discourse Representation Theory and formal semantics in general]

\RequirePackage{ifthen}
\RequirePackage{xyling}
\RequirePackage{xytree}%This package is needed, otherwise there's trouble with the trees... but I dont know why!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%The \lab[]{} command and all its variants%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\lab
\newcommand{\lab}[2][]{\ensuremath{\pi#1_{#2}}}

\newcommand{\labone}{\ensuremath{\lab{1}}} 
\newcommand{\labtwo}{\ensuremath{\lab{2}}}
\newcommand{\labthree}{\ensuremath{\lab{3}}} 
\newcommand{\labfour}{\ensuremath{\lab{4}}} 
\newcommand{\labfive}{\ensuremath{\lab{5}}} 
\newcommand{\labsix}{\ensuremath{\lab{6}}} 
\newcommand{\labseven}{\ensuremath{\lab{7}}} 
\newcommand{\labeight}{\ensuremath{\lab{8}}} 
\newcommand{\labnine}{\ensuremath{\lab{9}}} 
\newcommand{\labzero}{\ensuremath{\lab{0}}} 

\newcommand{\labprime}{\ensuremath{\lab[']{}}}
\newcommand{\labsecond}{\ensuremath{\lab['']{}}}
\newcommand{\labthird}{\ensuremath{\lab[''']{}}}
\newcommand{\labfourth}{\ensuremath{\lab['''']{}}}

%\klab
\newcommand{\klab}[2][]{\ensuremath{\lab[#1]{#2} : K_{\lab[#1]{#2}}}}

\newcommand{\klabone}{\ensuremath{\klab{1}}} 
\newcommand{\klabtwo}{\ensuremath{\klab{2}}}
\newcommand{\klabthree}{\ensuremath{\klab{3}}} 
\newcommand{\klabfour}{\ensuremath{\klab{4}}} 
\newcommand{\klabfive}{\ensuremath{\klab{5}}} 
\newcommand{\klabsix}{\ensuremath{\klab{6}}} 
\newcommand{\klabseven}{\ensuremath{\klab{7}}} 
\newcommand{\klabeight}{\ensuremath{\klab{8}}} 
\newcommand{\klabnine}{\ensuremath{\klab{9}}} 
\newcommand{\klabzero}{\ensuremath{\klab{0}}}

%\klabstar
\newcommand{\klabstar}[2][]{\ensuremath{\lab[#1]{#2} : K^{+}_{\lab[#1]{#2}}}}

\newcommand{\klabstarone}{\ensuremath{\klabstar{1}}} 
\newcommand{\klabstartwo}{\ensuremath{\klabstar{2}}}
\newcommand{\klabstarthree}{\ensuremath{\klabstar{3}}} 
\newcommand{\klabstarfour}{\ensuremath{\klabstar{4}}} 
\newcommand{\klabstarfive}{\ensuremath{\klabstar{5}}} 
\newcommand{\klabstarsix}{\ensuremath{\klabstar{6}}} 
\newcommand{\klabstarseven}{\ensuremath{\klabstar{7}}} 
\newcommand{\klabstareight}{\ensuremath{\klabstar{8}}} 
\newcommand{\klabstarnine}{\ensuremath{\klabstar{9}}} 
\newcommand{\klabstarzero}{\ensuremath{\klabstar{0}}}

%\flab
\newcommand{\flab}[2][]{\ensuremath{\mathcal{F}(\lab[#1]{#2})}}

\newcommand{\flabone}{\ensuremath{\flab{1}}} 
\newcommand{\flabtwo}{\ensuremath{\flab{2}}}
\newcommand{\flabthree}{\ensuremath{\flab{3}}} 
\newcommand{\flabfour}{\ensuremath{\flab{4}}} 
\newcommand{\flabfive}{\ensuremath{\flab{5}}} 
\newcommand{\flabsix}{\ensuremath{\flab{6}}} 
\newcommand{\flabseven}{\ensuremath{\flab{7}}} 
\newcommand{\flabeight}{\ensuremath{\flab{8}}} 
\newcommand{\flabnine}{\ensuremath{\flab{9}}} 
\newcommand{\flabzero}{\ensuremath{\flab{0}}}

%\flabk
\newcommand{\fklab}[2][]{\ensuremath{\flab[#1]{#2} = K_{\lab[#1]{#2}}}}

\newcommand{\fklabone}{\ensuremath{\fklab{1}}} 
\newcommand{\fklabtwo}{\ensuremath{\fklab{2}}}
\newcommand{\fklabthree}{\ensuremath{\fklab{3}}} 
\newcommand{\fklabfour}{\ensuremath{\fklab{4}}} 
\newcommand{\fklabfive}{\ensuremath{\fklab{5}}} 
\newcommand{\fklabsix}{\ensuremath{\fklab{6}}} 
\newcommand{\fklabseven}{\ensuremath{\fklab{7}}} 
\newcommand{\fklabeight}{\ensuremath{\fklab{8}}} 
\newcommand{\fklabnine}{\ensuremath{\fklab{9}}} 
\newcommand{\fklabzero}{\ensuremath{\fklab{0}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%A shorthand for discourse relations%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\dr}[3]{\ensuremath{#1(\pi_{#2}, \pi_{#3})}}

%%%%%%%%%%%
%Variables%
%%%%%%%%%%%
\newcommand{\varsub}[2]{\ensuremath{#1_{#2}}}
\newcommand{\varsup}[2]{\ensuremath{#1^{#2}}}

%%%%%%%%%%
%\(P)SDRS%
%%%%%%%%%%

\newcommand{\SDRS}[3][none]
{\ifthenelse{\equal{#1}{none}}{\ensuremath
    {\hspace{2ex}
    \begin{array}{|l|}
    \hline
    ~ \vspace{-2.5ex}\\
    #2\\
    ~ \vspace{-2.5ex} \\
    \hline
    \\
    #3\hspace{5pt}\\
    \\    
    \hline
    \end{array}
    }
}
{\ensuremath
    {#1: \hspace{-.5ex}
    \begin{array}{|l|}
    \hline
    ~ \vspace{-2.5ex}\\
    #2\\
    ~ \vspace{-2.5ex} \\
    \hline
    \\
    #3\hspace{5pt}\\
    \\    
    \hline
    \end{array}
    }}
}

%Presupposed versions
\newcommand{\PSDRS}[3][none]{\ifthenelse{\equal{#1}{none}}{\ensuremath{\partial\left(\; \hspace{-2ex}\SDRS{#2}{#3}\; \right)}}{\ensuremath{#1: \partial\left(\; \SDRS{#2}{#3}\; \right)}}}
\newcommand{\pres}[1]{\ensuremath{\partial(#1)}}

%%%%%%%
%Trees%
%%%%%%%
\newcommand{\sdrtree}[1]{\Treek[1]{2}{#1}}
\newcommand{\LAB}[1]{\K{ #1}}
\newcommand{\cons}[1][d]{\Bk{.5}{-2}{#1}}
\newcommand{\consl}{\Bk{1}{-2}{dl}}
\newcommand{\consr}{\Bk{1}{-2}{dr}}
\newcommand{\srel}[2][d]{\ARk{.5}{-2}{#1}^{$#2$}}
\newcommand{\srell}[1]{\ARk{1}{-2}{dl}_{$#1$}}
\newcommand{\srelr}[1]{\ARk{1}{-2}{dr}^{$#1$}}
\newcommand{\crel}[2][rr]{\GBkk{3,2.5}{-1.7,-3.5}{#1}{->}_{$#2$}}

%%%%%%%%%
%Symbols%
%%%%%%%%%
\newcommand{\intens}[1]{\ensuremath{^{\wedge}#1}}
\newcommand{\extens}[1]{\ensuremath{^{\vee}#1}}
\newcommand{\true}[1]{\ensuremath{\delta#1}}
\newcommand{\necess}[2]{\ensuremath{[#1]#2}}
\newcommand{\possib}[2]{\ensuremath{\langle #1\rangle #2}}
\newcommand{\append}[2]{\ensuremath{#1^{\cap}#2}}
\newcommand{\summary}{\ensuremath{\sqcap}}
\newcommand{\merging}{\ensuremath{\sqcup}}
\newcommand{\aflast}{\ensuremath{\langle A, \mathcal{F}, LAST\rangle}}
\newcommand{\topic}{\ensuremath{\Downarrow}}
\newcommand{\believes}[2][]{\ifthenelse{\equal{#1}{}}{\ensuremath{\mathcal{B}_{#2}}}{\ensuremath{\mathcal{B}_{#2}(#1)}}}
\newcommand{\intends}[2][]{\ifthenelse{\equal{#1}{}}{\ensuremath{\mathcal{I}_{#2}}}{\ensuremath{\mathcal{I}_{#2}(#1)}}}
\newcommand{\extends}{\ensuremath{\subseteq}}
\newcommand{\Lbracket}{[\hspace{-.4ex}[}
\newcommand{\Rbracket}{]\hspace{-.4ex}]}
\newcommand{\ccp}[4][]{\ensuremath{(#2)\Lbracket #3\Rbracket_{#1}(#4)}}
\newcommand{\nmentp}[1][]{\ensuremath{{|\hspace{-4.8pt}\sim}_{#1}}}
\newcommand{\nmentm}[1][]{\ensuremath{{|\hspace{-5pt}\approx}_{#1}}}
\newcommand{\entm}[1][]{\ensuremath{\models_{#1}}}
\newcommand{\entp}[1][]{\ensuremath{\vdash_{#1}}}
\newcommand{\Nnmentp}[1][]{\ensuremath{{|\hspace{-4.8pt}\not\sim}_{#1}}}
\newcommand{\Nnmentm}[1][]{\ensuremath{{|\hspace{-5pt}\not\approx}_{#1}}}
\newcommand{\Nentm}[1][]{\ensuremath{\not\models_{#1}}}
\newcommand{\Nentp}[1][]{\ensuremath{\not\vdash_{#1}}}
\newcommand{\sarg}[2]{\scshape sarg\upshape\ensuremath{(#1, #2)}}
\newcommand{\outscopes}{\ensuremath{\succ}}
\newcommand{\tempprec}{\ensuremath{\prec}}
\newcommand{\lulf}{\ensuremath{\varsub{\mathcal{L}}{ulf}}}
\newcommand{\trfunc}{\ensuremath{\nu}}
\newcommand{\resolves}{\ensuremath{\leadsto}}
\newcommand{\kstar}{\ensuremath{K^{+}}}
\newcommand{\thext}{\ensuremath{T^{\rightarrow}}}
\newcommand{\update}{\emph{update}\textsubscript{\scshape sdrt}}
\newcommand{\bestupdate}{\emph{Best-update}\textsubscript{\scshape sdrt}}
\newcommand{\downdate}{\ensuremath{\downarrow}}
\newcommand{\revision}{\ensuremath{\otimes}}
\newcommand{\ulf}{\ensuremath{\mathcal{K}}}
\newcommand{\access}{\ensuremath{\leq}}
\newcommand{\efdeq}{\ensuremath{\coloneq}}
\newcommand{\union}[1]{\ensuremath{\bigcup\limits_{#1}}}
\newcommand{\subtype}{\ensuremath{\sqsubseteq}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Here is the code of the subscript.sty package used for \update, along with the license%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% subscript.sty
%
% Copyright 1999 Robin Fairbairns
%
% this fragment is distributed under the conditions of the LaTeX
% Project Public Licence -- see lppl.txt in the LaTeX distribution
%
% this fragment provides a command \textsubscript, which is
% shamelessly copied from the command \textsuperscript that's part of
% LaTeX
%
% the fragment may be used as a package in its own right, if so
% needed.

\DeclareRobustCommand*\textsubscript[1]{%
  \@textsubscript{\selectfont#1}}
\def\@textsubscript#1{%
  {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}