
krauss@23004: %  Mathpartir --- Math Paragraph for Typesetting Inference Rules
krauss@23004: %
krauss@23004: %  Copyright (C) 2001, 2002, 2003, 2004, 2005 Didier R�my
krauss@23004: %
krauss@23004: %  Author         : Didier Remy 
krauss@23004: %  Version        : 1.2.0
krauss@23004: %  Bug Reports    : to author
krauss@23004: %  Web Site       : http://pauillac.inria.fr/~remy/latex/
krauss@23004: % 
krauss@23004: %  Mathpartir is free software; you can redistribute it and/or modify
krauss@23004: %  it under the terms of the GNU General Public License as published by
krauss@23004: %  the Free Software Foundation; either version 2, or (at your option)
krauss@23004: %  any later version.
krauss@23004: %  
krauss@23004: %  Mathpartir is distributed in the hope that it will be useful,
krauss@23004: %  but WITHOUT ANY WARRANTY; without even the implied warranty of
krauss@23004: %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
krauss@23004: %  GNU General Public License for more details 
krauss@23004: %  (http://pauillac.inria.fr/~remy/license/GPL).
krauss@23004: %
krauss@23004: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
krauss@23004: %  File mathpartir.sty (LaTeX macros)
krauss@23004: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
krauss@23004: 
krauss@23004: \NeedsTeXFormat{LaTeX2e}
krauss@23004: \ProvidesPackage{mathpartir}
krauss@23004:     [2005/12/20 version 1.2.0 Math Paragraph for Typesetting Inference Rules]
krauss@23004: 
krauss@23004: %%
krauss@23004: 
krauss@23004: %% Identification
krauss@23004: %% Preliminary declarations
krauss@23004: 
krauss@23004: \RequirePackage {keyval}
krauss@23004: 
krauss@23004: %% Options
krauss@23004: %% More declarations
krauss@23004: 
krauss@23004: %% PART I: Typesetting maths in paragraphe mode
krauss@23004: 
krauss@23004: \newdimen \mpr@tmpdim
krauss@23004: 
krauss@23004: % To ensure hevea \hva compatibility, \hva should expands to nothing 
krauss@23004: % in mathpar or in inferrule
krauss@23004: \let \mpr@hva \empty
krauss@23004: 
krauss@23004: %% normal paragraph parametters, should rather be taken dynamically
krauss@23004: \def \mpr@savepar {%
krauss@23004:   \edef \MathparNormalpar
krauss@23004:      {\noexpand \lineskiplimit \the\lineskiplimit
krauss@23004:       \noexpand \lineskip \the\lineskip}%
krauss@23004:   }
krauss@23004: 
krauss@23004: \def \mpr@rulelineskip {\lineskiplimit=0.3em\lineskip=0.2em plus 0.1em}
krauss@23004: \def \mpr@lesslineskip {\lineskiplimit=0.6em\lineskip=0.5em plus 0.2em}
krauss@23004: \def \mpr@lineskip  {\lineskiplimit=1.2em\lineskip=1.2em plus 0.2em}
krauss@23004: \let \MathparLineskip \mpr@lineskip
krauss@23004: \def \mpr@paroptions {\MathparLineskip}
krauss@23004: \let \mpr@prebindings \relax
krauss@23004: 
krauss@23004: \newskip \mpr@andskip \mpr@andskip 2em plus 0.5fil minus 0.5em
krauss@23004: 
krauss@23004: \def \mpr@goodbreakand
krauss@23004:    {\hskip -\mpr@andskip  \penalty -1000\hskip \mpr@andskip}
krauss@23004: \def \mpr@and {\hskip \mpr@andskip}
krauss@23004: \def \mpr@andcr {\penalty 50\mpr@and}
krauss@23004: \def \mpr@cr {\penalty -10000\mpr@and}
krauss@23004: \def \mpr@eqno #1{\mpr@andcr #1\hskip 0em plus -1fil \penalty 10}
krauss@23004: 
krauss@23004: \def \mpr@bindings {%
krauss@23004:   \let \and \mpr@andcr
krauss@23004:   \let \par \mpr@andcr
krauss@23004:   \let \\\mpr@cr
krauss@23004:   \let \eqno \mpr@eqno
krauss@23004:   \let \hva \mpr@hva
krauss@23004:   } 
krauss@23004: \let \MathparBindings \mpr@bindings
krauss@23004: 
krauss@23004: % \@ifundefined {ignorespacesafterend}
krauss@23004: %    {\def \ignorespacesafterend {\aftergroup \ignorespaces}
krauss@23004: 
krauss@23004: \newenvironment{mathpar}[1][]
krauss@23004:   {$$\mpr@savepar \parskip 0em \hsize \linewidth \centering
krauss@23004:      \vbox \bgroup \mpr@prebindings \mpr@paroptions #1\ifmmode $\else
krauss@23004:      \noindent $\displaystyle\fi
krauss@23004:      \MathparBindings}
krauss@23004:   {\unskip \ifmmode $\fi\egroup $$\ignorespacesafterend}
krauss@23004: 
krauss@23004: % \def \math@mathpar #1{\setbox0 \hbox {$\displaystyle #1$}\ifnum
krauss@23004: %     \wd0 < \hsize  $$\box0$$\else \bmathpar #1\emathpar \fi}
krauss@23004: 
krauss@23004: %%% HOV BOXES
krauss@23004: 
krauss@23004: \def \mathvbox@ #1{\hbox \bgroup \mpr@normallineskip 
krauss@23004:   \vbox \bgroup \tabskip 0em \let \\ \cr
krauss@23004:   \halign \bgroup \hfil $##$\hfil\cr #1\crcr \egroup \egroup
krauss@23004:   \egroup}
krauss@23004: 
krauss@23004: \def \mathhvbox@ #1{\setbox0 \hbox {\let \\\qquad $#1$}\ifnum \wd0 < \hsize
krauss@23004:       \box0\else \mathvbox {#1}\fi}
krauss@23004: 
krauss@23004: 
krauss@23004: %% Part II -- operations on lists
krauss@23004: 
krauss@23004: \newtoks \mpr@lista
krauss@23004: \newtoks \mpr@listb
krauss@23004: 
krauss@23004: \long \def\mpr@cons #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
krauss@23004: {#2}\edef #2{\the \mpr@lista \the \mpr@listb}}
krauss@23004: 
krauss@23004: \long \def\mpr@snoc #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
krauss@23004: {#2}\edef #2{\the \mpr@listb\the\mpr@lista}}
krauss@23004: 
krauss@23004: \long \def \mpr@concat#1=#2\mpr@to#3{\mpr@lista \expandafter {#2}\mpr@listb
krauss@23004: \expandafter {#3}\edef #1{\the \mpr@listb\the\mpr@lista}}
krauss@23004: 
krauss@23004: \def \mpr@head #1\mpr@to #2{\expandafter \mpr@head@ #1\mpr@head@ #1#2}
krauss@23004: \long \def \mpr@head@ #1#2\mpr@head@ #3#4{\def #4{#1}\def#3{#2}}
krauss@23004: 
krauss@23004: \def \mpr@flatten #1\mpr@to #2{\expandafter \mpr@flatten@ #1\mpr@flatten@ #1#2}
krauss@23004: \long \def \mpr@flatten@ \\#1\\#2\mpr@flatten@ #3#4{\def #4{#1}\def #3{\\#2}}
krauss@23004: 
krauss@23004: \def \mpr@makelist #1\mpr@to #2{\def \mpr@all {#1}%
krauss@23004:    \mpr@lista {\\}\mpr@listb \expandafter {\mpr@all}\edef \mpr@all {\the
krauss@23004:    \mpr@lista \the \mpr@listb \the \mpr@lista}\let #2\empty 
krauss@23004:    \def \mpr@stripof ##1##2\mpr@stripend{\def \mpr@stripped{##2}}\loop
krauss@23004:      \mpr@flatten \mpr@all \mpr@to \mpr@one
krauss@23004:      \expandafter \mpr@snoc \mpr@one \mpr@to #2\expandafter \mpr@stripof
krauss@23004:      \mpr@all \mpr@stripend  
krauss@23004:      \ifx \mpr@stripped \empty \let \mpr@isempty 0\else \let \mpr@isempty 1\fi
krauss@23004:      \ifx 1\mpr@isempty
krauss@23004:    \repeat
krauss@23004: }
krauss@23004: 
krauss@23004: \def \mpr@rev #1\mpr@to #2{\let \mpr@tmp \empty
krauss@23004:    \def \\##1{\mpr@cons ##1\mpr@to \mpr@tmp}#1\let #2\mpr@tmp}
krauss@23004: 
krauss@23004: %% Part III -- Type inference rules
krauss@23004: 
krauss@23004: \newif \if@premisse
krauss@23004: \newbox \mpr@hlist
krauss@23004: \newbox \mpr@vlist
krauss@23004: \newif \ifmpr@center \mpr@centertrue
krauss@23004: \def \mpr@htovlist {%
krauss@23004:    \setbox \mpr@hlist
krauss@23004:       \hbox {\strut
krauss@23004:              \ifmpr@center \hskip -0.5\wd\mpr@hlist\fi
krauss@23004:              \unhbox \mpr@hlist}%
krauss@23004:    \setbox \mpr@vlist
krauss@23004:       \vbox {\if@premisse  \box \mpr@hlist \unvbox \mpr@vlist
krauss@23004:              \else \unvbox \mpr@vlist \box \mpr@hlist
krauss@23004:              \fi}%
krauss@23004: }
krauss@23004: % OLD version
krauss@23004: % \def \mpr@htovlist {%
krauss@23004: %    \setbox \mpr@hlist
krauss@23004: %       \hbox {\strut \hskip -0.5\wd\mpr@hlist \unhbox \mpr@hlist}%
krauss@23004: %    \setbox \mpr@vlist
krauss@23004: %       \vbox {\if@premisse  \box \mpr@hlist \unvbox \mpr@vlist
krauss@23004: %              \else \unvbox \mpr@vlist \box \mpr@hlist
krauss@23004: %              \fi}%
krauss@23004: % }
krauss@23004: 
krauss@23004: \def \mpr@item #1{$\displaystyle #1$}
krauss@23004: \def \mpr@sep{2em}
krauss@23004: \def \mpr@blank { }
krauss@23004: \def \mpr@hovbox #1#2{\hbox
krauss@23004:   \bgroup
krauss@23004:   \ifx #1T\@premissetrue
krauss@23004:   \else \ifx #1B\@premissefalse
krauss@23004:   \else
krauss@23004:      \PackageError{mathpartir}
krauss@23004:        {Premisse orientation should either be T or B}
krauss@23004:        {Fatal error in Package}%
krauss@23004:   \fi \fi
krauss@23004:   \def \@test {#2}\ifx \@test \mpr@blank\else
krauss@23004:   \setbox \mpr@hlist \hbox {}%
krauss@23004:   \setbox \mpr@vlist \vbox {}%
krauss@23004:   \if@premisse \let \snoc \mpr@cons \else \let \snoc \mpr@snoc \fi
krauss@23004:   \let \@hvlist \empty \let \@rev \empty
krauss@23004:   \mpr@tmpdim 0em
krauss@23004:   \expandafter \mpr@makelist #2\mpr@to \mpr@flat
krauss@23004:   \if@premisse \mpr@rev \mpr@flat \mpr@to \@rev \else \let \@rev \mpr@flat \fi
krauss@23004:   \def \\##1{%
krauss@23004:      \def \@test {##1}\ifx \@test \empty
krauss@23004:         \mpr@htovlist
krauss@23004:         \mpr@tmpdim 0em %%% last bug fix not extensively checked
krauss@23004:      \else
krauss@23004:       \setbox0 \hbox{\mpr@item {##1}}\relax
krauss@23004:       \advance \mpr@tmpdim by \wd0
krauss@23004:       %\mpr@tmpdim 1.02\mpr@tmpdim
krauss@23004:       \ifnum \mpr@tmpdim < \hsize
krauss@23004:          \ifnum \wd\mpr@hlist > 0
krauss@23004:            \if@premisse
krauss@23004:              \setbox \mpr@hlist 
krauss@23004:                 \hbox {\unhbox0 \hskip \mpr@sep \unhbox \mpr@hlist}%
krauss@23004:            \else
krauss@23004:              \setbox \mpr@hlist
krauss@23004:                 \hbox {\unhbox \mpr@hlist  \hskip \mpr@sep \unhbox0}%
krauss@23004:            \fi
krauss@23004:          \else 
krauss@23004:          \setbox \mpr@hlist \hbox {\unhbox0}%
krauss@23004:          \fi
krauss@23004:       \else
krauss@23004:          \ifnum \wd \mpr@hlist > 0
krauss@23004:             \mpr@htovlist 
krauss@23004:             \mpr@tmpdim \wd0
krauss@23004:          \fi
krauss@23004:          \setbox \mpr@hlist \hbox {\unhbox0}%
krauss@23004:       \fi
krauss@23004:       \advance \mpr@tmpdim by \mpr@sep
krauss@23004:    \fi
krauss@23004:    }%
krauss@23004:    \@rev
krauss@23004:    \mpr@htovlist
krauss@23004:    \ifmpr@center \hskip \wd\mpr@vlist\fi \box \mpr@vlist
krauss@23004:    \fi
krauss@23004:    \egroup
krauss@23004: }
krauss@23004: 
krauss@23004: %%% INFERENCE RULES
krauss@23004: 
krauss@23004: \@ifundefined{@@over}{%
krauss@23004:     \let\@@over\over % fallback if amsmath is not loaded
krauss@23004:     \let\@@overwithdelims\overwithdelims
krauss@23004:     \let\@@atop\atop \let\@@atopwithdelims\atopwithdelims
krauss@23004:     \let\@@above\above \let\@@abovewithdelims\abovewithdelims
krauss@23004:   }{}
krauss@23004: 
krauss@23004: %% The default
krauss@23004: 
krauss@23004: \def \mpr@@fraction #1#2{\hbox {\advance \hsize by -0.5em
krauss@23004:     $\displaystyle {#1\mpr@over #2}$}}
krauss@23004: \let \mpr@fraction \mpr@@fraction
krauss@23004: 
krauss@23004: %% A generic solution to arrow
krauss@23004: 
krauss@23004: \def \mpr@make@fraction #1#2#3#4#5{\hbox {%
krauss@23004:      \def \mpr@tail{#1}%
krauss@23004:      \def \mpr@body{#2}%
krauss@23004:      \def \mpr@head{#3}%
krauss@23004:      \setbox1=\hbox{$#4$}\setbox2=\hbox{$#5$}%
krauss@23004:      \setbox3=\hbox{$\mkern -3mu\mpr@body\mkern -3mu$}%
krauss@23004:      \setbox3=\hbox{$\mkern -3mu \mpr@body\mkern -3mu$}%
krauss@23004:      \dimen0=\dp1\advance\dimen0 by \ht3\relax\dp1\dimen0\relax
krauss@23004:      \dimen0=\ht2\advance\dimen0 by \dp3\relax\ht2\dimen0\relax
krauss@23004:      \setbox0=\hbox {$\box1 \@@atop \box2$}%
krauss@23004:      \dimen0=\wd0\box0
krauss@23004:      \box0 \hskip -\dimen0\relax
krauss@23004:      \hbox to \dimen0 {$%
krauss@23004:        \mathrel{\mpr@tail}\joinrel
krauss@23004:        \xleaders\hbox{\copy3}\hfil\joinrel\mathrel{\mpr@head}%
krauss@23004:      $}}}
krauss@23004: 
krauss@23004: %% Old stuff should be removed in next version
krauss@23004: \def \mpr@@reduce #1#2{\hbox
krauss@23004:     {$\lower 0.01pt \mpr@@fraction {#1}{#2}\mkern -15mu\rightarrow$}}
krauss@23004: \def \mpr@@rewrite #1#2#3{\hbox
krauss@23004:     {$\lower 0.01pt \mpr@@fraction {#2}{#3}\mkern -8mu#1$}}
krauss@23004: \def \mpr@infercenter #1{\vcenter {\mpr@hovbox{T}{#1}}}
krauss@23004: 
krauss@23004: \def \mpr@empty {}
krauss@23004: \def \mpr@inferrule
krauss@23004:   {\bgroup
krauss@23004:      \ifnum \linewidth<\hsize \hsize \linewidth\fi
krauss@23004:      \mpr@rulelineskip
krauss@23004:      \let \and \qquad
krauss@23004:      \let \hva \mpr@hva
krauss@23004:      \let \@rulename \mpr@empty
krauss@23004:      \let \@rule@options \mpr@empty
krauss@23004:      \let \mpr@over \@@over
krauss@23004:      \mpr@inferrule@}
krauss@23004: \newcommand {\mpr@inferrule@}[3][]
krauss@23004:   {\everymath={\displaystyle}%       
krauss@23004:    \def \@test {#2}\ifx \empty \@test
krauss@23004:       \setbox0 \hbox {$\vcenter {\mpr@hovbox{B}{#3}}$}%
krauss@23004:    \else 
krauss@23004:    \def \@test {#3}\ifx \empty \@test
krauss@23004:       \setbox0 \hbox {$\vcenter {\mpr@hovbox{T}{#2}}$}%
krauss@23004:    \else
krauss@23004:    \setbox0 \mpr@fraction {\mpr@hovbox{T}{#2}}{\mpr@hovbox{B}{#3}}%
krauss@23004:    \fi \fi
krauss@23004:    \def \@test {#1}\ifx \@test\empty \box0
krauss@23004:    \else \vbox 
krauss@23004: %%% Suggestion de Francois pour les etiquettes longues
krauss@23004: %%%   {\hbox to \wd0 {\RefTirName {#1}\hfil}\box0}\fi
krauss@23004:       {\hbox {\RefTirName {#1}}\box0}\fi
krauss@23004:    \egroup}
krauss@23004: 
krauss@23004: \def \mpr@vdotfil #1{\vbox to #1{\leaders \hbox{$\cdot$} \vfil}}
krauss@23004: 
krauss@23004: % They are two forms
krauss@23004: % \inferrule [label]{[premisses}{conclusions}
krauss@23004: % or
krauss@23004: % \inferrule* [options]{[premisses}{conclusions}
krauss@23004: %
krauss@23004: % Premisses and conclusions are lists of elements separated by \\
krauss@23004: % Each \\ produces a break, attempting horizontal breaks if possible, 
krauss@23004: % and  vertical breaks if needed. 
krauss@23004: % 
krauss@23004: % An empty element obtained by \\\\ produces a vertical break in all cases. 
krauss@23004: %
krauss@23004: % The former rule is aligned on the fraction bar. 
krauss@23004: % The optional label appears on top of the rule
krauss@23004: % The second form to be used in a derivation tree is aligned on the last
krauss@23004: % line of its conclusion
krauss@23004: % 
krauss@23004: % The second form can be parameterized, using the key=val interface. The
krauss@23004: % folloiwng keys are recognized:
krauss@23004: %       
krauss@23004: %  width                set the width of the rule to val
krauss@23004: %  narrower             set the width of the rule to val\hsize
krauss@23004: %  before               execute val at the beginning/left
krauss@23004: %  lab                  put a label [Val] on top of the rule
krauss@23004: %  lskip                add negative skip on the right
krauss@23004: %  left                 put a left label [Val]
krauss@23004: %  Left                 put a left label [Val],  ignoring its width 
krauss@23004: %  right                put a right label [Val]
krauss@23004: %  Right                put a right label [Val], ignoring its width
krauss@23004: %  leftskip             skip negative space on the left-hand side
krauss@23004: %  rightskip            skip negative space on the right-hand side
krauss@23004: %  vdots                lift the rule by val and fill vertical space with dots
krauss@23004: %  after                execute val at the end/right
krauss@23004: %  
krauss@23004: %  Note that most options must come in this order to avoid strange
krauss@23004: %  typesetting (in particular  leftskip must preceed left and Left and
krauss@23004: %  rightskip must follow Right or right; vdots must come last 
krauss@23004: %  or be only followed by rightskip. 
krauss@23004: %  
krauss@23004: 
krauss@23004: %% Keys that make sence in all kinds of rules
krauss@23004: \def \mprset #1{\setkeys{mprset}{#1}}
krauss@23004: \define@key {mprset}{flushleft}[]{\mpr@centerfalse}
krauss@23004: \define@key {mprset}{center}[]{\mpr@centertrue}
krauss@23004: \define@key {mprset}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
krauss@23004: \define@key {mprset}{myfraction}[]{\let \mpr@fraction #1}
krauss@23004: \define@key {mprset}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
krauss@23004: 
krauss@23004: \newbox \mpr@right
krauss@23004: \define@key {mpr}{flushleft}[]{\mpr@centerfalse}
krauss@23004: \define@key {mpr}{center}[]{\mpr@centertrue}
krauss@23004: \define@key {mpr}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
krauss@23004: \define@key {mpr}{myfraction}[]{\let \mpr@fraction #1}
krauss@23004: \define@key {mpr}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
krauss@23004: \define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
krauss@23004:      \advance \hsize by -\wd0\box0}
krauss@23004: \define@key {mpr}{width}{\hsize #1}
krauss@23004: \define@key {mpr}{sep}{\def\mpr@sep{#1}}
krauss@23004: \define@key {mpr}{before}{#1}
krauss@23004: \define@key {mpr}{lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
krauss@23004: \define@key {mpr}{Lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
krauss@23004: \define@key {mpr}{narrower}{\hsize #1\hsize}
krauss@23004: \define@key {mpr}{leftskip}{\hskip -#1}
krauss@23004: \define@key {mpr}{reduce}[]{\let \mpr@fraction \mpr@@reduce}
krauss@23004: \define@key {mpr}{rightskip}
krauss@23004:   {\setbox \mpr@right \hbox {\unhbox \mpr@right \hskip -#1}}
krauss@23004: \define@key {mpr}{LEFT}{\setbox0 \hbox {$#1$}\relax
krauss@23004:      \advance \hsize by -\wd0\box0}
krauss@23004: \define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
krauss@23004:      \advance \hsize by -\wd0\box0}
krauss@23004: \define@key {mpr}{Left}{\llap{$\TirName {#1}\;$}}
krauss@23004: \define@key {mpr}{right}
krauss@23004:   {\setbox0 \hbox {$\;\TirName {#1}$}\relax \advance \hsize by -\wd0
krauss@23004:    \setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
krauss@23004: \define@key {mpr}{RIGHT}
krauss@23004:   {\setbox0 \hbox {$#1$}\relax \advance \hsize by -\wd0
krauss@23004:    \setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
krauss@23004: \define@key {mpr}{Right}
krauss@23004:   {\setbox \mpr@right \hbox {\unhbox \mpr@right \rlap {$\;\TirName {#1}$}}}
krauss@23004: \define@key {mpr}{vdots}{\def \mpr@vdots {\@@atop \mpr@vdotfil{#1}}}
krauss@23004: \define@key {mpr}{after}{\edef \mpr@after {\mpr@after #1}}
krauss@23004: 
krauss@23004: \newdimen \rule@dimen
krauss@23004: \newcommand \mpr@inferstar@ [3][]{\setbox0
krauss@23004:   \hbox {\let \mpr@rulename \mpr@empty \let \mpr@vdots \relax
krauss@23004:          \setbox \mpr@right \hbox{}%
krauss@23004:          $\setkeys{mpr}{#1}%
krauss@23004:           \ifx \mpr@rulename \mpr@empty \mpr@inferrule {#2}{#3}\else
krauss@23004:           \mpr@inferrule [{\mpr@rulename}]{#2}{#3}\fi
krauss@23004:           \box \mpr@right \mpr@vdots$}
krauss@23004:   \setbox1 \hbox {\strut}
krauss@23004:   \rule@dimen \dp0 \advance \rule@dimen by -\dp1
krauss@23004:   \raise \rule@dimen \box0}
krauss@23004: 
krauss@23004: \def \mpr@infer {\@ifnextchar *{\mpr@inferstar}{\mpr@inferrule}}
krauss@23004: \newcommand \mpr@err@skipargs[3][]{}
krauss@23004: \def \mpr@inferstar*{\ifmmode 
krauss@23004:     \let \@do \mpr@inferstar@
krauss@23004:   \else 
krauss@23004:     \let \@do \mpr@err@skipargs
krauss@23004:     \PackageError {mathpartir}
krauss@23004:       {\string\inferrule* can only be used in math mode}{}%
krauss@23004:   \fi \@do}
krauss@23004: 
krauss@23004: 
krauss@23004: %%% Exports
krauss@23004: 
krauss@23004: % Envirnonment mathpar
krauss@23004: 
krauss@23004: \let \inferrule \mpr@infer
krauss@23004: 
krauss@23004: % make a short name \infer is not already defined
krauss@23004: \@ifundefined {infer}{\let \infer \mpr@infer}{}
krauss@23004: 
krauss@23004: \def \TirNameStyle #1{\small \textsc{#1}}
krauss@23004: \def \tir@name #1{\hbox {\small \TirNameStyle{#1}}}
krauss@23004: \let \TirName \tir@name
krauss@23004: \let \DefTirName \TirName
krauss@23004: \let \RefTirName \TirName
krauss@23004: 
krauss@23004: %%% Other Exports
krauss@23004: 
krauss@23004: % \let \listcons \mpr@cons
krauss@23004: % \let \listsnoc \mpr@snoc
krauss@23004: % \let \listhead \mpr@head
krauss@23004: % \let \listmake \mpr@makelist
krauss@23004: 
krauss@23004: 
krauss@23004: 
krauss@23004: 
krauss@23004: \endinput




