summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/esrelation/esrelation.sty
blob: 324ea77f4246d11733dd3bdade5bee1131d09e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%%
%% 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
%% 
\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'.