%%
%% This is file `esrelation.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% esrelation.dtx  (with options: `style')
%% 
%% Copyright (C) 2015
%% by Byron Cook, Tauba Auerbach, and David Reinfurt
%% 
%% This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is [here](http://www.latex-project.org/lppl.txt) and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{esrelation}
\DeclareSymbolFont{esrelation}{U}{esrelation}{m}{n}
\DeclareMathSymbol{\arrwr}{\mathord}{esrelation}{'022} % arrow_project_right
\DeclareMathSymbol{\arrwl}{\mathord}{esrelation}{'023} % arrow_project_left
\DeclareMathSymbol{\brktr}{\mathrel}{esrelation}{'025} % bracket_project_right
\DeclareMathSymbol{\brktl}{\mathrel}{esrelation}{'024} % bracket_project_left
\DeclareMathSymbol{\brktlift}{\mathrel}{esrelation}{'026} % bracket_lifting
\DeclareMathSymbol{\barshort}{\mathrel}{esrelation}{'040}
\DeclareMathSymbol{\barlong}{\mathrel}{esrelation}{'043}
\DeclareMathSymbol{\verticalbarshort}{\mathord}{esrelation}{'045}
\DeclareMathSymbol{\verticalbarlongleft}{\mathord}{esrelation}{'044}
\DeclareMathSymbol{\verticalbarlongright}{\mathord}{esrelation}{'046}
\DeclareMathSymbol{\restrictwand}{\mathord}{esrelation}{'027}
\DeclareMathSymbol{\restrictbarb}{\mathord}{esrelation}{'030}
\DeclareMathSymbol{\restrictmallet}{\mathord}{esrelation}{'021}
\DeclareMathSymbol{\restrictwandup}{\mathord}{esrelation}{'050}
\DeclareMathSymbol{\restrictbarbup}{\mathord}{esrelation}{'051}
\DeclareMathSymbol{\restrictmalletup}{\mathord}{esrelation}{'052}
%%----------------------------------------
%% 0. main
%%----------------------------------------

\ProcessOptions\relax

\def\relationrightproject{\parindent 0pt\mathpalette{\relationbuildprojectright\relationbarfill}}
\def\relationleftproject{\parindent 0pt\mathpalette{\relationbuildprojectleft\relationbarfill}}
\def\relationlifting{\parindent 0pt\mathpalette{\relationbuildlifting\relationbarfill}}
%%----------------------------------------
%% 1. fills
%%----------------------------------------

\def\relationbarfill#1{
\m@th\leaders\hbox{$\mkern-2mu\barlong\mkern-2mu$}\hfill
}

\def\relationverticalbarfillleft#1{
  \hbox to .5em{\vbox to #1{
  \leaders\hbox{\hbox{$\verticalbarlongleft$}}
  \vfill\kern-.5em$\verticalbarlongleft$}}
}

\def\relationverticalbarfillright#1{
  \hbox to .5em{\vbox to #1{
  \leaders\hbox{\hbox{$\verticalbarlongright$}}
  \vfill\kern-.5em$\verticalbarlongright$}}
}
%%----------------------------------------
%% 2. build
%%----------------------------------------

\def\relationbuildprojectright #1#2#3{
%% #1 = \relationbarfill
%% #2 = \mathchoice
%% #3 = \relationleftproject{...}
\setbox0=\hbox{$#3$} %% main expression
\dimen0=\ht0 %% main box height
\dimen1=\wd0 %% main box width
\vbox{
\ialign{##\crcr
\noalign{\kern-.3em\nointerlineskip} %% overline
\hbox to \dimen1{$\kern.1em\brktr$#1#2}$\mkern-3mu
\arrwr$\crcr
\noalign{\kern-.1em\nointerlineskip}$\m@th %% main
\kern.1em\relationverticalbarfillleft{\dimen0}\kern-.3em\box0 $\crcr
}
}
}

\def\relationbuildprojectleft #1#2#3{
%% #1 = \relationbarfill
%% #2 = \mathchoice
%% #3 = \relationleftproject{...}
\setbox0=\hbox{$#3$} %% main expression
\dimen0=\ht0 %% main box height
\dimen1=\wd0 %% main box width
\vbox{
\ialign{##\crcr
\noalign{\kern-.3em\nointerlineskip} %% overline
\hbox to \dimen1{$\mkern2mu\arrwl$#1#2}$\kern.1em\brktl$\crcr
\noalign{\kern-.1em\nointerlineskip}$\m@th %% main
\mkern3mu\box0\mkern-3mu\kern.1em\relationverticalbarfillright{
\dimen0}$\crcr
}
}
}

\def\relationbuildlifting #1#2#3{
%% #1 = \relationbarfill
%% #2 = \mathchoice
%% #3 = \relationbuildlifting{...}
\setbox0=\hbox{$#3$} %% main expression
\dimen0=\ht0 %% main box height
\dimen1=\wd0 %% main box width
\advance\dimen1 by -.25em %% close horizontal gap
\lower.75ex\hbox{\vbox{
\ialign{##\crcr
\noalign{\kern0em\nointerlineskip}$\m@th %% main
\kern.1em\relationverticalbarfillleft{\dimen0}\mkern-5mu
\box0 $\crcr
\noalign{\kern-.2em\nointerlineskip} %% underline
\hbox to \dimen1{$\kern.1em\brktlift$#1#2}$\mkern-3mu\barlong
\barlong$\crcr
}
}
}\kern-.25em
}

\endinput
%%
%% End of file `esrelation.sty'.
