slides/mathpartir.sty
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 19 Nov 2013 23:44:49 +0000
changeset 197 6622bd256029
parent 95 dbe49327b6c5
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
95
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
%  Mathpartir --- Math Paragraph for Typesetting Inference Rules
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
%  Copyright (C) 2001, 2002, 2003, 2004, 2005 Didier Rémy
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
%  Author         : Didier Remy 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
%  Version        : 1.2.0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
%  Bug Reports    : to author
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
%  Web Site       : http://pauillac.inria.fr/~remy/latex/
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
% 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
%  Mathpartir is free software; you can redistribute it and/or modify
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
%  it under the terms of the GNU General Public License as published by
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
%  the Free Software Foundation; either version 2, or (at your option)
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
%  any later version.
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
%  
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
%  Mathpartir is distributed in the hope that it will be useful,
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
%  GNU General Public License for more details 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
%  (http://pauillac.inria.fr/~remy/license/GPL).
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
%  File mathpartir.sty (LaTeX macros)
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
\NeedsTeXFormat{LaTeX2e}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
\ProvidesPackage{mathpartir}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
    [2005/12/20 version 1.2.0 Math Paragraph for Typesetting Inference Rules]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
%%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
%% Identification
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
%% Preliminary declarations
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
\RequirePackage {keyval}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
%% Options
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
%% More declarations
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
%% PART I: Typesetting maths in paragraphe mode
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
%% \newdimen \mpr@tmpdim
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
%% Dimens are a precious ressource. Uses seems to be local.
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
\let \mpr@tmpdim \@tempdima
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
% To ensure hevea \hva compatibility, \hva should expands to nothing 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
% in mathpar or in inferrule
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
\let \mpr@hva \empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
%% normal paragraph parametters, should rather be taken dynamically
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
\def \mpr@savepar {%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
  \edef \MathparNormalpar
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
     {\noexpand \lineskiplimit \the\lineskiplimit
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
      \noexpand \lineskip \the\lineskip}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
  }
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
\def \mpr@rulelineskip {\lineskiplimit=0.3em\lineskip=0.2em plus 0.1em}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
\def \mpr@lesslineskip {\lineskiplimit=0.6em\lineskip=0.5em plus 0.2em}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
\def \mpr@lineskip  {\lineskiplimit=1.2em\lineskip=1.2em plus 0.2em}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
\let \MathparLineskip \mpr@lineskip
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
\def \mpr@paroptions {\MathparLineskip}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
\let \mpr@prebindings \relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
\newskip \mpr@andskip \mpr@andskip 2em plus 0.5fil minus 0.5em
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
\def \mpr@goodbreakand
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
   {\hskip -\mpr@andskip  \penalty -1000\hskip \mpr@andskip}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
\def \mpr@and {\hskip \mpr@andskip}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
\def \mpr@andcr {\penalty 50\mpr@and}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
\def \mpr@cr {\penalty -10000\mpr@and}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
\def \mpr@eqno #1{\mpr@andcr #1\hskip 0em plus -1fil \penalty 10}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
\def \mpr@bindings {%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
  \let \and \mpr@andcr
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
  \let \par \mpr@andcr
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
  \let \\\mpr@cr
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
  \let \eqno \mpr@eqno
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
  \let \hva \mpr@hva
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
  } 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
\let \MathparBindings \mpr@bindings
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
% \@ifundefined {ignorespacesafterend}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
%    {\def \ignorespacesafterend {\aftergroup \ignorespaces}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
\newenvironment{mathpar}[1][]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    85
  {$$\mpr@savepar \parskip 0em \hsize \linewidth \centering
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
     \vbox \bgroup \mpr@prebindings \mpr@paroptions #1\ifmmode $\else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
     \noindent $\displaystyle\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
     \MathparBindings}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
  {\unskip \ifmmode $\fi\egroup $$\ignorespacesafterend}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
\newenvironment{mathparpagebreakable}[1][]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
  {\begingroup 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
   \par
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    94
   \mpr@savepar \parskip 0em \hsize \linewidth \centering
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
      \mpr@prebindings \mpr@paroptions #1%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
      \vskip \abovedisplayskip \vskip -\lineskip%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
     \ifmmode  \else  $\displaystyle\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
     \MathparBindings
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
  }
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
  {\unskip
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
   \ifmmode $\fi \par\endgroup
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
   \vskip \belowdisplayskip
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
   \noindent
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
  \ignorespacesafterend}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
% \def \math@mathpar #1{\setbox0 \hbox {$\displaystyle #1$}\ifnum
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
%     \wd0 < \hsize  $$\box0$$\else \bmathpar #1\emathpar \fi}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
%%% HOV BOXES
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   110
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
\def \mathvbox@ #1{\hbox \bgroup \mpr@normallineskip 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
  \vbox \bgroup \tabskip 0em \let \\ \cr
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
  \halign \bgroup \hfil $##$\hfil\cr #1\crcr \egroup \egroup
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
  \egroup}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
\def \mathhvbox@ #1{\setbox0 \hbox {\let \\\qquad $#1$}\ifnum \wd0 < \hsize
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
      \box0\else \mathvbox {#1}\fi}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
%% Part II -- operations on lists
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
\newtoks \mpr@lista
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   123
\newtoks \mpr@listb
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
\long \def\mpr@cons #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
{#2}\edef #2{\the \mpr@lista \the \mpr@listb}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
\long \def\mpr@snoc #1\mpr@to#2{\mpr@lista {\\{#1}}\mpr@listb \expandafter
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
{#2}\edef #2{\the \mpr@listb\the\mpr@lista}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   131
\long \def \mpr@concat#1=#2\mpr@to#3{\mpr@lista \expandafter {#2}\mpr@listb
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   132
\expandafter {#3}\edef #1{\the \mpr@listb\the\mpr@lista}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   133
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
\def \mpr@head #1\mpr@to #2{\expandafter \mpr@head@ #1\mpr@head@ #1#2}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   135
\long \def \mpr@head@ #1#2\mpr@head@ #3#4{\def #4{#1}\def#3{#2}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
\def \mpr@flatten #1\mpr@to #2{\expandafter \mpr@flatten@ #1\mpr@flatten@ #1#2}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   138
\long \def \mpr@flatten@ \\#1\\#2\mpr@flatten@ #3#4{\def #4{#1}\def #3{\\#2}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   139
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
\def \mpr@makelist #1\mpr@to #2{\def \mpr@all {#1}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   141
   \mpr@lista {\\}\mpr@listb \expandafter {\mpr@all}\edef \mpr@all {\the
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   142
   \mpr@lista \the \mpr@listb \the \mpr@lista}\let #2\empty 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   143
   \def \mpr@stripof ##1##2\mpr@stripend{\def \mpr@stripped{##2}}\loop
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   144
     \mpr@flatten \mpr@all \mpr@to \mpr@one
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   145
     \expandafter \mpr@snoc \mpr@one \mpr@to #2\expandafter \mpr@stripof
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   146
     \mpr@all \mpr@stripend  
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   147
     \ifx \mpr@stripped \empty \let \mpr@isempty 0\else \let \mpr@isempty 1\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   148
     \ifx 1\mpr@isempty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   149
   \repeat
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   150
}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   151
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   152
\def \mpr@rev #1\mpr@to #2{\let \mpr@tmp \empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   153
   \def \\##1{\mpr@cons ##1\mpr@to \mpr@tmp}#1\let #2\mpr@tmp}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   154
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
%% Part III -- Type inference rules
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
\newif \if@premisse
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
\newbox \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   159
\newbox \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
\newif \ifmpr@center \mpr@centertrue
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
\def \mpr@htovlist {%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   162
   \setbox \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   163
      \hbox {\strut
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
             \ifmpr@center \hskip -0.5\wd\mpr@hlist\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   165
             \unhbox \mpr@hlist}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   166
   \setbox \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   167
      \vbox {\if@premisse  \box \mpr@hlist \unvbox \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   168
             \else \unvbox \mpr@vlist \box \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   169
             \fi}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   170
}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   171
% OLD version
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   172
% \def \mpr@htovlist {%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   173
%    \setbox \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   174
%       \hbox {\strut \hskip -0.5\wd\mpr@hlist \unhbox \mpr@hlist}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
%    \setbox \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   176
%       \vbox {\if@premisse  \box \mpr@hlist \unvbox \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   177
%              \else \unvbox \mpr@vlist \box \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   178
%              \fi}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   179
% }
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   180
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   181
\def \mpr@item #1{$\displaystyle #1$}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   182
\def \mpr@sep{2em}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   183
\def \mpr@blank { }
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   184
\def \mpr@hovbox #1#2{\hbox
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   185
  \bgroup
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   186
  \ifx #1T\@premissetrue
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   187
  \else \ifx #1B\@premissefalse
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   188
  \else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   189
     \PackageError{mathpartir}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   190
       {Premisse orientation should either be T or B}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   191
       {Fatal error in Package}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   192
  \fi \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   193
  \def \@test {#2}\ifx \@test \mpr@blank\else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   194
  \setbox \mpr@hlist \hbox {}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   195
  \setbox \mpr@vlist \vbox {}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   196
  \if@premisse \let \snoc \mpr@cons \else \let \snoc \mpr@snoc \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   197
  \let \@hvlist \empty \let \@rev \empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   198
  \mpr@tmpdim 0em
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   199
  \expandafter \mpr@makelist #2\mpr@to \mpr@flat
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   200
  \if@premisse \mpr@rev \mpr@flat \mpr@to \@rev \else \let \@rev \mpr@flat \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   201
  \def \\##1{%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   202
     \def \@test {##1}\ifx \@test \empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   203
        \mpr@htovlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   204
        \mpr@tmpdim 0em %%% last bug fix not extensively checked
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   205
     \else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   206
      \setbox0 \hbox{\mpr@item {##1}}\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
      \advance \mpr@tmpdim by \wd0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   208
      %\mpr@tmpdim 1.02\mpr@tmpdim
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   209
      \ifnum \mpr@tmpdim < \hsize
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   210
         \ifnum \wd\mpr@hlist > 0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
           \if@premisse
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
             \setbox \mpr@hlist 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   213
                \hbox {\unhbox0 \hskip \mpr@sep \unhbox \mpr@hlist}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   214
           \else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
             \setbox \mpr@hlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
                \hbox {\unhbox \mpr@hlist  \hskip \mpr@sep \unhbox0}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   217
           \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
         \else 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
         \setbox \mpr@hlist \hbox {\unhbox0}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
         \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
      \else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   222
         \ifnum \wd \mpr@hlist > 0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
            \mpr@htovlist 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   224
            \mpr@tmpdim \wd0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   225
         \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
         \setbox \mpr@hlist \hbox {\unhbox0}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   227
      \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   228
      \advance \mpr@tmpdim by \mpr@sep
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   229
   \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   230
   }%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   231
   \@rev
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   232
   \mpr@htovlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   233
   \ifmpr@center \hskip \wd\mpr@vlist\fi \box \mpr@vlist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   234
   \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
   \egroup
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   238
%%% INFERENCE RULES
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   239
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   240
\@ifundefined{@@over}{%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   241
    \let\@@over\over % fallback if amsmath is not loaded
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
    \let\@@overwithdelims\overwithdelims
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   243
    \let\@@atop\atop \let\@@atopwithdelims\atopwithdelims
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   244
    \let\@@above\above \let\@@abovewithdelims\abovewithdelims
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   245
  }{}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   246
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   247
%% The default
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   248
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   249
\def \mpr@@fraction #1#2{\hbox {\advance \hsize by -0.5em
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   250
    $\displaystyle {#1\mpr@over #2}$}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   251
\def \mpr@@nofraction #1#2{\hbox {\advance \hsize by -0.5em
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   252
    $\displaystyle {#1\@@atop #2}$}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   253
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   254
\let \mpr@fraction \mpr@@fraction
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   255
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   256
%% A generic solution to arrow
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   257
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   258
\def \mpr@make@fraction #1#2#3#4#5{\hbox {%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   259
     \def \mpr@tail{#1}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   260
     \def \mpr@body{#2}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   261
     \def \mpr@head{#3}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   262
     \setbox1=\hbox{$#4$}\setbox2=\hbox{$#5$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   263
     \setbox3=\hbox{$\mkern -3mu\mpr@body\mkern -3mu$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   264
     \setbox3=\hbox{$\mkern -3mu \mpr@body\mkern -3mu$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   265
     \dimen0=\dp1\advance\dimen0 by \ht3\relax\dp1\dimen0\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   266
     \dimen0=\ht2\advance\dimen0 by \dp3\relax\ht2\dimen0\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   267
     \setbox0=\hbox {$\box1 \@@atop \box2$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   268
     \dimen0=\wd0\box0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   269
     \box0 \hskip -\dimen0\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   270
     \hbox to \dimen0 {$%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   271
       \mathrel{\mpr@tail}\joinrel
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   272
       \xleaders\hbox{\copy3}\hfil\joinrel\mathrel{\mpr@head}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   273
     $}}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   274
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   275
%% Old stuff should be removed in next version
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   276
\def \mpr@@nothing #1#2
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   277
    {$\lower 0.01pt \mpr@@nofraction {#1}{#2}$}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   278
\def \mpr@@reduce #1#2{\hbox
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   279
    {$\lower 0.01pt \mpr@@fraction {#1}{#2}\mkern -15mu\rightarrow$}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   280
\def \mpr@@rewrite #1#2#3{\hbox
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   281
    {$\lower 0.01pt \mpr@@fraction {#2}{#3}\mkern -8mu#1$}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   282
\def \mpr@infercenter #1{\vcenter {\mpr@hovbox{T}{#1}}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   283
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   284
\def \mpr@empty {}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   285
\def \mpr@inferrule
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   286
  {\bgroup
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   287
     \ifnum \linewidth<\hsize \hsize \linewidth\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   288
     \mpr@rulelineskip
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   289
     \let \and \qquad
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   290
     \let \hva \mpr@hva
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   291
     \let \@rulename \mpr@empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   292
     \let \@rule@options \mpr@empty
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   293
     \let \mpr@over \@@over
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   294
     \mpr@inferrule@}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   295
\newcommand {\mpr@inferrule@}[3][]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   296
  {\everymath={\displaystyle}%       
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   297
   \def \@test {#2}\ifx \empty \@test
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   298
      \setbox0 \hbox {$\vcenter {\mpr@hovbox{B}{#3}}$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   299
   \else 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   300
   \def \@test {#3}\ifx \empty \@test
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   301
      \setbox0 \hbox {$\vcenter {\mpr@hovbox{T}{#2}}$}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   302
   \else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   303
   \setbox0 \mpr@fraction {\mpr@hovbox{T}{#2}}{\mpr@hovbox{B}{#3}}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   304
   \fi \fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   305
   \def \@test {#1}\ifx \@test\empty \box0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   306
   \else \vbox 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   307
%%% Suggestion de Francois pour les etiquettes longues
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   308
%%%   {\hbox to \wd0 {\RefTirName {#1}\hfil}\box0}\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   309
      {\hbox {\RefTirName {#1}}\box0}\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   310
   \egroup}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   311
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   312
\def \mpr@vdotfil #1{\vbox to #1{\leaders \hbox{$\cdot$} \vfil}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   313
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   314
% They are two forms
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   315
% \inferrule [label]{[premisses}{conclusions}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   316
% or
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   317
% \inferrule* [options]{[premisses}{conclusions}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   318
%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   319
% Premisses and conclusions are lists of elements separated by \\
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   320
% Each \\ produces a break, attempting horizontal breaks if possible, 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   321
% and  vertical breaks if needed. 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   322
% 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   323
% An empty element obtained by \\\\ produces a vertical break in all cases. 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   324
%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   325
% The former rule is aligned on the fraction bar. 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   326
% The optional label appears on top of the rule
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   327
% The second form to be used in a derivation tree is aligned on the last
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   328
% line of its conclusion
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   329
% 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   330
% The second form can be parameterized, using the key=val interface. The
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   331
% folloiwng keys are recognized:
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   332
%       
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   333
%  width                set the width of the rule to val
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   334
%  narrower             set the width of the rule to val\hsize
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   335
%  before               execute val at the beginning/left
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   336
%  lab                  put a label [Val] on top of the rule
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   337
%  lskip                add negative skip on the right
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   338
%  left                 put a left label [Val]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   339
%  Left                 put a left label [Val],  ignoring its width 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   340
%  right                put a right label [Val]
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   341
%  Right                put a right label [Val], ignoring its width
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   342
%  leftskip             skip negative space on the left-hand side
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   343
%  rightskip            skip negative space on the right-hand side
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   344
%  vdots                lift the rule by val and fill vertical space with dots
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   345
%  after                execute val at the end/right
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   346
%  
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   347
%  Note that most options must come in this order to avoid strange
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   348
%  typesetting (in particular  leftskip must preceed left and Left and
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   349
%  rightskip must follow Right or right; vdots must come last 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   350
%  or be only followed by rightskip. 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   351
%  
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   352
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   353
%% Keys that make sence in all kinds of rules
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   354
\def \mprset #1{\setkeys{mprset}{#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   355
\define@key {mprset}{andskip}[]{\mpr@andskip=#1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   356
\define@key {mprset}{lineskip}[]{\lineskip=#1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   357
\define@key {mprset}{flushleft}[]{\mpr@centerfalse}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   358
\define@key {mprset}{center}[]{\mpr@centertrue}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   359
\define@key {mprset}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   360
\define@key {mprset}{atop}[]{\let \mpr@fraction \mpr@@nofraction}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   361
\define@key {mprset}{myfraction}[]{\let \mpr@fraction #1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   362
\define@key {mprset}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   363
\define@key {mprset}{sep}{\def\mpr@sep{#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   364
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   365
\newbox \mpr@right
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   366
\define@key {mpr}{flushleft}[]{\mpr@centerfalse}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   367
\define@key {mpr}{center}[]{\mpr@centertrue}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   368
\define@key {mpr}{rewrite}[]{\let \mpr@fraction \mpr@@rewrite}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   369
\define@key {mpr}{myfraction}[]{\let \mpr@fraction #1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   370
\define@key {mpr}{fraction}[]{\def \mpr@fraction {\mpr@make@fraction #1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   371
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   372
     \advance \hsize by -\wd0\box0}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   373
\define@key {mpr}{width}{\hsize #1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   374
\define@key {mpr}{sep}{\def\mpr@sep{#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   375
\define@key {mpr}{before}{#1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   376
\define@key {mpr}{lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   377
\define@key {mpr}{Lab}{\let \RefTirName \TirName \def \mpr@rulename {#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   378
\define@key {mpr}{narrower}{\hsize #1\hsize}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   379
\define@key {mpr}{leftskip}{\hskip -#1}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   380
\define@key {mpr}{reduce}[]{\let \mpr@fraction \mpr@@reduce}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   381
\define@key {mpr}{rightskip}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   382
  {\setbox \mpr@right \hbox {\unhbox \mpr@right \hskip -#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   383
\define@key {mpr}{LEFT}{\setbox0 \hbox {$#1$}\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   384
     \advance \hsize by -\wd0\box0}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   385
\define@key {mpr}{left}{\setbox0 \hbox {$\TirName {#1}\;$}\relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   386
     \advance \hsize by -\wd0\box0}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   387
\define@key {mpr}{Left}{\llap{$\TirName {#1}\;$}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   388
\define@key {mpr}{right}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   389
  {\setbox0 \hbox {$\;\TirName {#1}$}\relax \advance \hsize by -\wd0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   390
   \setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   391
\define@key {mpr}{RIGHT}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   392
  {\setbox0 \hbox {$#1$}\relax \advance \hsize by -\wd0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   393
   \setbox \mpr@right \hbox {\unhbox \mpr@right \unhbox0}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   394
\define@key {mpr}{Right}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   395
  {\setbox \mpr@right \hbox {\unhbox \mpr@right \rlap {$\;\TirName {#1}$}}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   396
\define@key {mpr}{vdots}{\def \mpr@vdots {\@@atop \mpr@vdotfil{#1}}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   397
\define@key {mpr}{after}{\edef \mpr@after {\mpr@after #1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   398
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   399
\newcommand \mpr@inferstar@ [3][]{\setbox0
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   400
  \hbox {\let \mpr@rulename \mpr@empty \let \mpr@vdots \relax
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   401
         \setbox \mpr@right \hbox{}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   402
         $\setkeys{mpr}{#1}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   403
          \ifx \mpr@rulename \mpr@empty \mpr@inferrule {#2}{#3}\else
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   404
          \mpr@inferrule [{\mpr@rulename}]{#2}{#3}\fi
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   405
          \box \mpr@right \mpr@vdots$}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   406
  \setbox1 \hbox {\strut}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   407
  \@tempdima \dp0 \advance \@tempdima by -\dp1
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   408
  \raise \@tempdima \box0}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   409
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   410
\def \mpr@infer {\@ifnextchar *{\mpr@inferstar}{\mpr@inferrule}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   411
\newcommand \mpr@err@skipargs[3][]{}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   412
\def \mpr@inferstar*{\ifmmode 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   413
    \let \@do \mpr@inferstar@
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   414
  \else 
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   415
    \let \@do \mpr@err@skipargs
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   416
    \PackageError {mathpartir}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   417
      {\string\inferrule* can only be used in math mode}{}%
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   418
  \fi \@do}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   419
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   420
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   421
%%% Exports
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   422
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   423
% Envirnonment mathpar
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   424
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   425
\let \inferrule \mpr@infer
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   426
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   427
% make a short name \infer is not already defined
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   428
\@ifundefined {infer}{\let \infer \mpr@infer}{}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   429
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   430
\def \TirNameStyle #1{\small \textsc{#1}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   431
\def \tir@name #1{\hbox {\small \TirNameStyle{#1}}}
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   432
\let \TirName \tir@name
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   433
\let \DefTirName \TirName
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   434
\let \RefTirName \TirName
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   435
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   436
%%% Other Exports
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   437
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   438
% \let \listcons \mpr@cons
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   439
% \let \listsnoc \mpr@snoc
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   440
% \let \listhead \mpr@head
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   441
% \let \listmake \mpr@makelist
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   442
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   443
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   444
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   445
dbe49327b6c5 added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   446
\endinput