% % a first attempt at defining LaTeX macros for MRS typesetting % % Copyright (c) 2007 -- 2009 Stephan Oepen (oe@ifi.uio.no) % \iffalse \sblock{\sh{0}}{% \sep{\svar{h}{1}{}}{\_sleep\_v}{% \srv{ARG0}{e}{0}{\svp{TENSE}{past}}, \srv{ARG1}{x}{0}{}},\\ \slep{2}{proper\_q}{% \srv{ARG0}{x}{0}{}, \srv{RSTR}{h}{3}{}, \srv{BODY}{h}{4}{}},\\ \slep{5}{named}{% \srv{ARG0}{x}{0}{}, \src{CARG}{Browne}}}% {\sqeq{0}{1}, \sqeq{3}{5}} \fi % % two global switches, to control whether role labels and variable properties % are included in the output or not. % \newif\ifroles\rolestrue \newif\ifproperties\propertiestrue \newif\iflnk\lnktrue \newcommand{\rolenewline}{% \ifroles\\\fi} % % used to foreground select MRS elements, e.g. predicates or variables % \newif\iffocuscontext\focuscontextfalse \newcommand{\sfocus}[1]{% \iffalse {\focuscontexttrue #1}% \else \fboxsep 0.8pt\psset{linewidth=1pt,boxsep=false}% \psovalbox{#1}% \fi} % % a variable, e.g. \svar{e}{2}{\svp{TENSE}{past}} or \svar{h}{0}{} % \newcommand{\svar}[3]{% {\fboxsep 0pt \def\testa{}\def\testb{\_}\def\testc{#1}\def\testd{#2}\def\teste{#3}% \ensuremath{% \mbox{\textsf{\textit{% \ifmetacontext\uppercase{#1}\else% \ifx\testb\testc\raisebox{-0.15ex}{\srule}% \else#1\fi\fi}}}% \ifx\testa\testd\else_{#2}\fi% \ifproperties\ifx\testa\teste\else\svps{#3}\fi\fi}}} \newcommand{\svps}[1]{% \ensuremath{\lbrace\hspace{0.00ex}#1\hspace{0.00ex}\rbrace}} % % shorthands for frequent variable types (no variable properties), e.g. \sh{0} % \newcommand{\sh}[1]{% \svar{h}{#1}{}} \newcommand{\se}[1]{% \svar{e}{#1}{}} \newcommand{\sx}[1]{% \svar{x}{#1}{}} \newcommand{\si}[1]{% \svar{i}{#1}{}} \newcommand{\sa}{% \svar{\_}{}{}} % % used in the presentation of transfer rules, flagging meta-variables % \newif\ifmetacontext\metacontextfalse \newcommand{\stag}[1]{% \iffalse {\metacontexttrue #1}% \else {\fboxsep 1pt \raisebox{0.1ex}{\fbox{\strut #1}}}% \fi} % % also mostly in transfer rules, a `wildcard' value % \newcommand{\srule}{% \raisebox{-0.15ex}{\rule{1.5ex}{0.05ex}}} % % a property label, e.g. \spl{TENSE} % \newcommand{\spl}[1]{% \mbox{\smaller\sffamily #1}} % % a property value, e.g. \spv{past} % \newcommand{\spv}[1]{% \mbox{\smaller\sffamily\textit{#1}}} % % a variable property, e.g. \svp{TENSE}{past} % \newcommand{\svp}[2]{% \mbox{\spl{#1}~\spv{#2}}} % % a constant (or parameter), e.g. \sconst{Browne} (note, sans double quotes) % \newcommand{\sconst}[1]{% \mbox{\textsf{\textit{#1}}}} % % a role label, e.g. \srl{ARG0} % \newcommand{\srl}[1]{% \mbox{\textsf{\smaller #1}}} % % a role (i.e. role -- value) pair in an EP, e.g. \srole{ARG0}{\svar{e}{2}} % \newcommand{\srole}[2]{% \mbox{% \def\testa{}\def\testb{#2}% \textsf{\ifroles\srl{#1}~\fi\ifx\testa\testb\srule{}\else#2\fi}}} % % as a matter of convenience, these are shorthand macros for role -- variable % and role -- constant pairs, essentially wrapping \srole{} et al. % \newcommand{\srv}[4]{% \srole{#1}{\svar{#2}{#3}{#4}}} \newcommand{\src}[2]{% \srole{#1}{\sconst{#2}}} % % a predicate symbol, e.g. \spred{\_sleep\_v} % \newcommand{\spred}[1]{% \mbox{\textsf{#1}}} % % various forms of surface LNKs, anchoring a predicate in the parser input % \newcommand{\slnkc}[2]{% \iflnk% {\def\testa{}\def\testb{#1}\def\testc{#2}% \ensuremath{% \left\langle% \ifx\testa\testb\else#1\fi\!:\!\ifx\testa\testc\else#2\fi \right\rangle}}\fi} % % one elementary predication, see above for examples % \newcommand{\sep}[3]{% {\def\testa{}\def\testb{#1}\def\testc{#3}% \textsf{\ifx\testa\testb\else#1:\fi\spred{#2}% \ifx\testa\testc\else\hspace{0.05ex}(\hspace{0.05ex}% \begin{tabular}[t]{@{}l@{}}#3\hspace{0.05ex})\end{tabular}\fi}}} % % another shorthand: a _labeled_ elementary predication % \newcommand{\slep}[3]{% \sep{\svar{h}{#1}{}}{#2}{#3}} % % a QEQ handle constraint, e.g. \sqeq{0}{1} % \newcommand{\sqeq}[2]{% {\def\testa{}\def\testb{#1}\def\testc{#2}% \ensuremath{% \ifx\testa\testb\else\sh{#1}\fi=_q\ifx\testa\testc\else\sh{#2}\fi}}} % % a `raw' QEQ handle constraint, for use in transfer rules % \newcommand{\srqeq}[2]{% \ensuremath{#1=_q#2}} % % a bag of EPs, sometimes used to abbreviate the gist of an MRS % \newcommand{\seps}[1]{% $\lbrace\,$#1$\,\rbrace$} % % a bag of handle constraints, e.g. \shcons{\sqeq{47}{11}} % \newcommand{\shcons}[1]{% {\def\testa{}\def\testb{#1}% $\left\lbrace\,#1\ifx\testa\testb\else\,\fi\right\rbrace$}} % % one MRS, typeset in paragraph mode (just like regular text) % \newcommand{\stext}[3]{% $\langle\,$#1, \seps{#2}, \shcons{#3}$\,\rangle$} % % one MRS, typeset in boxed mode; use `\\' to force line breaks among EPs % \newcommand{\sblock}[3]{% \fboxsep 0pt \ensuremath{% \vcenter{% \def\testa{}\def\testb{#1}% \hbox{\vbox{% \hbox{$\langle\,$#1\ifx\testa\testb\else,\fi}% \hbox{\phantom{$\langle\,$}% \hskip -0.0ex% \ensuremath{% \begin{array}{@{}|l|@{}}% #2\\ \end{array}}}% \hbox{\phantom{$\langle\,$}\hskip -0.1ex\shcons{#3}$\,\rangle$}}}}}} % % a minor variant of the above, also including the top-level INDEX, approved % by ann in mid-2016. % \newcommand{\siblock}[4]{% \fboxsep 0pt \ensuremath{% \vcenter{% \def\testa{}\def\testb{#1}\def\testc{#2}% \hbox{\vbox{% \hbox{$\langle\,$#1\ifx\testa\testb\else,\fi% \ifx\testa\testc\else$\,$\fi#2\ifx\testa\testc\else,\fi}% \hbox{\phantom{$\langle\,$}% \hskip -0.0ex% \ensuremath{% \begin{array}{@{}|l|@{}}% #3\\ \end{array}}}% \hbox{\phantom{$\langle\,$}\hskip -0.1ex\shcons{#4}$\,\rangle$}}}}}} \newcommand{\eds}[2]{% \fboxsep 0pt \ensuremath{% \vcenter{% \hbox{\vbox{% \hbox{$\lbrace\,$#1}% \hbox{\phantom{$\lbrace\,$}% \hskip -0.0ex% \ensuremath{% \begin{array}{@{}l@{}}% #2\\ \end{array}}}% \hbox{$\rbrace$}}}}}} % % % \newcommand{\sat}[5]{% \fboxsep 0pt \ensuremath{% \vcenter{% \hbox{\vbox{% \hbox{#1}% \hbox{\sholes{#2}}% \hbox{% \hskip -0.0ex% \ensuremath{% \begin{array}{@{}|l|@{}}% #3\\ \end{array}}}% \hbox{\shcons{#4}} \hbox{\shcons{#5}}}}}}} \newcommand{\satl}[5]{% \fboxsep 0pt \ensuremath{% \hbox{% \hbox{#1}\hskip 0.8ex \hbox{\sholes{#2}}\hskip 0.8ex \hbox{% \hskip -0.0ex% \ensuremath{\tabcolsep 0.01em% \begin{array}{@{}|l|@{}}% \hskip -0.4ex #3\hskip -0.4ex\\ \end{array}}}\hskip 0.8ex \hbox{\shcons{#4}}\hskip 0.8ex \hbox{\shcons{#5}}}}} \newcommand{\shook}[3]{% {\def\testa{}\def\testb{#1}\def\testc{#2}\def\testd{#3}% \textsf{% \hbox{$\langle\,$\hskip -0.1ex% \ifx\testa\testb\svar{\_}{}{}\else{#1}\fi, \ifx\testa\testc\svar{\_}{}{}\else{#2}\fi, \ifx\testa\testd\svar{\_}{}{}\else{#3}\fi$\,\rangle$}}}} \newcommand{\seq}[2]{% \ensuremath{\,#1 \equiv #2}} \newcommand{\shl}[1]{% \hbox{\sffamily\scshape #1}} \newcommand{\shole}[4]{% \textsf{\hbox{% \raisebox{-0.6ex}{\smaller\shl{#1}}% \shook{#2}{#3}{#4}}}} \newcommand{\slhole}[2]{% \hbox{\textsf% {\def\testa{}\def\testb{#2}% \raisebox{-0.6ex}{\smaller\shl{#1}}% $\left[\,#2\ifx\testa\testb\else\,\fi\right]$}}} \newcommand{\srhole}[2]{% \textsf{\hbox{\raisebox{-0.6ex}{\smaller\sffamily\scshape #1}{#2}}}} \newcommand{\sholes}[1]{% {\def\testa{}\def\testb{#1}\fboxsep 0pt% \mbox{$\left\lbrace#1\right\rbrace$}}} \newcommand{\sop}[1]{ \hbox{$\bullet$\hskip 0.5pt\raisebox{-0.6ex}{\smaller\sffamily\scshape #1}}} \newcommand{\svtag}[2]{ {\fboxsep 1pt\fbox{% \smaller\sffamily#1\strut\raisebox{-0.6ex}{\smaller #2}}}}