| 1 |
% mathematical symbols by Anthony Phan. |
| 2 |
% file: mathsubs.mf (subset symbols) |
| 3 |
% last modification: May 16, 2005. |
| 4 |
% Only known charcodes will be generated. |
| 5 |
|
| 6 |
% Inclusion signs and related things (relations). |
| 7 |
% Some pictures overlap the bottom. It is necessary |
| 8 |
% for correct centering of the whole box. |
| 9 |
% Spreads for cross bars have been checked. |
| 10 |
|
| 11 |
def horizontal_rules_list=math_axis, |
| 12 |
-body_depth,-desc_depth,x_height,cap_height,asc_height,body_height |
| 13 |
enddef; |
| 14 |
|
| 15 |
%turningcheck:=0; |
| 16 |
|
| 17 |
use_rule1; |
| 18 |
|
| 19 |
beginpicture(tmp,12u#+2appr#,v_center(spread2#+rth#)); |
| 20 |
pickup tiny.nib; |
| 21 |
if main_name_string="subset": |
| 22 |
pos1(rth,90); pos2(rth,90); |
| 23 |
pos4(rth,270); pos5(rth,270); |
| 24 |
y1-y5=spread2; 0.5[y1,y5]=y3=math_axis; y2=y1; y4=y5; |
| 25 |
rt x1=rt x5=w-Appr; x3-0.5rth=appr; x2=x4=1/3[x3,x1]; |
| 26 |
filldraw stroke z5e..z4e; filldraw stroke z2e..z1e; |
| 27 |
pickup rule.nib; autorounded; |
| 28 |
draw z2 left_to_down z3 down_to_right z4; |
| 29 |
elseif main_name_string="supset": |
| 30 |
pos1(rth,90); pos2(rth,90); |
| 31 |
pos3(rth,0); pos4(rth,-90); pos 5(rth,-90); |
| 32 |
y1-y5=spread2; 0.5[y1,y5]=y3=math_axis; y2=y1; y4=y5; |
| 33 |
lft x1=lft x5=Appr; x3+0.5rth=w-appr; x2=x4=1/3[x3,x1]; |
| 34 |
filldraw stroke z1e..z2e; filldraw stroke z4e..z5e; |
| 35 |
pickup rule.nib; autorounded; |
| 36 |
draw z2 right_to_down z3 down_to_left z4; |
| 37 |
elseif main_name_string="sqsubset": |
| 38 |
pos1(rth,90); pos4(rth,-90); |
| 39 |
x2l-x2r=x3l-x3r=rth-tiny; |
| 40 |
y1-y4=spread2; 0.5[y1,y4]=math_axis; |
| 41 |
rt x1=rt x4=w-Appr; lft x2r=lft x3r=Appr; |
| 42 |
forsuffixes $=r,l: y1$=y2$; y3$=y4$; endfor |
| 43 |
filldraw stroke z4e--z3e--z2e--z1e; |
| 44 |
else: |
| 45 |
pos1(rth,90); pos4(rth,-90); |
| 46 |
x2r-x2l=x3r-x3l=rth-tiny; |
| 47 |
y1-y4=spread2; 0.5[y1,y4]=math_axis; |
| 48 |
lft x1=lft x4=Appr; rt x2r=rt x3r=w-Appr; |
| 49 |
forsuffixes $=r,l: y1$=y2$; y3$=y4$; endfor |
| 50 |
filldraw stroke z1e--z2e--z3e--z4e; |
| 51 |
fi |
| 52 |
endpicture; |
| 53 |
|
| 54 |
beginchar(main_name_with(), |
| 55 |
12u#+2appr#,v_center(spread2#+rth#)); |
| 56 |
main_name_string&" sign"; |
| 57 |
currentpicture:=tmp_picture; |
| 58 |
endchar; |
| 59 |
|
| 60 |
beginchar(main_name_with(_not), |
| 61 |
12u#+2appr#,asc_height#,asc_depth#); |
| 62 |
"not "&main_name_string&" sign"; |
| 63 |
currentpicture:=tmp_picture; |
| 64 |
pickup tiny.nib; |
| 65 |
pos1(rth,0); pos2(rth,0); |
| 66 |
v_adjust(1l,2l,math_axis,max(h+d,spread2+spread1)); |
| 67 |
lft x1l=lft x2l=hround 0.5(w-rth); |
| 68 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 69 |
endchar; |
| 70 |
|
| 71 |
beginchar(main_name_with(_eq), |
| 72 |
12u#+2appr#,v_center(spread2#+rth#+spread1#)); |
| 73 |
main_name_string&" or equal sign"; |
| 74 |
currentpicture:=tmp_picture |
| 75 |
shifted(0,0.5spread1); |
| 76 |
pickup tiny.nib; |
| 77 |
pos1(rth,90); pos2(rth,90); |
| 78 |
y1=y2=math_axis-0.5(spread2+spread1); |
| 79 |
lft x1=Appr; rt x2=w-Appr; |
| 80 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 81 |
tmp_picture:=currentpicture; |
| 82 |
endchar; |
| 83 |
|
| 84 |
beginchar(main_name_with(_not_eq), |
| 85 |
12u#+2appr#,asc_height#,asc_depth#); |
| 86 |
"not "&main_name_string&" nor equal sign"; |
| 87 |
currentpicture:=tmp_picture; |
| 88 |
pickup tiny.nib; |
| 89 |
pos1(rth,0); pos2(rth,0); |
| 90 |
v_adjust(1l,2l,math_axis,max(h+d,spread2+2spread1)); |
| 91 |
lft x1l=lft x2l=hround 0.5(w-rth); |
| 92 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 93 |
endchar; |
| 94 |
|
| 95 |
beginchar(main_name_with(_eq_not), |
| 96 |
12u#+2appr#,v_center(spread2#+rth#+spread1#)); |
| 97 |
main_name_string&" but not equal sign"; |
| 98 |
currentpicture:=tmp_picture; |
| 99 |
pickup tiny.nib; |
| 100 |
y0=math_axis-0.5(spread2+spread1); |
| 101 |
x0=0.5w; |
| 102 |
v_adjust(1r,2l,y0,1.5spread1-0.5rth); |
| 103 |
lft x2l-Appr=w-Appr-rt x1r=hround 3.5u; |
| 104 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 105 |
filldraw stroke z1e..z2e; penlabels(0,1,2); |
| 106 |
endchar; |
| 107 |
|
| 108 |
beginchar(main_name_with(_eq_varnot), |
| 109 |
12u#+2appr#,v_center(spread2#+rth#+spread1#)); |
| 110 |
"variant "&main_name_string&" but not equal sign"; |
| 111 |
currentpicture:=tmp_picture; |
| 112 |
pickup tiny.nib; |
| 113 |
y0=math_axis-0.5spread2; x0=0.5w; |
| 114 |
v_adjust(1r,2l,y0,2.5spread1-0.5rth); |
| 115 |
lft x2l-Appr=w-Appr-rt x1r=hround 2.75u; |
| 116 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 117 |
filldraw stroke z1e..z2e; penlabels(0,1,2); |
| 118 |
endchar; |
| 119 |
|
| 120 |
beginchar(main_name_with(_eqq), |
| 121 |
12u#+2appr#,v_center(spread2#+rth#+2spread1#)); |
| 122 |
main_name_string&" or equal-equal sign"; |
| 123 |
currentpicture:=tmp_picture shifted(0,0.5spread1); |
| 124 |
pickup tiny.nib; |
| 125 |
pos1(rth,90); pos2(rth,90); |
| 126 |
y1=y2=math_axis+spread1-0.5spread2-2spread1; |
| 127 |
lft x1=Appr; rt x2=w-Appr; |
| 128 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 129 |
tmp_picture:=currentpicture; |
| 130 |
endchar; |
| 131 |
|
| 132 |
beginchar(main_name_with(_not_eqq), |
| 133 |
12u#+2appr#,asc_height#,asc_depth#); |
| 134 |
"not "&main_name_string&" nor equal-equal sign"; |
| 135 |
currentpicture:=tmp_picture; |
| 136 |
pickup tiny.nib; |
| 137 |
pos1(rth,0); pos2(rth,0); |
| 138 |
v_adjust(1l,2l,math_axis,max(h+d,spread2+3spread1)); |
| 139 |
lft x1l=lft x2l=hround 0.5(w-rth); |
| 140 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 141 |
endchar; |
| 142 |
|
| 143 |
beginchar(main_name_with(_eqq_not), |
| 144 |
12u#+2appr#,v_center(spread2#+rth#+2spread1#)); |
| 145 |
main_name_string&" but not equal-equal sign"; |
| 146 |
currentpicture:=tmp_picture; |
| 147 |
pickup tiny.nib; |
| 148 |
y0=math_axis-0.5(spread2+spread1); |
| 149 |
x0=0.5w; |
| 150 |
v_adjust(1r,2l,y0,2.5spread1-0.5rth); |
| 151 |
lft x2l-Appr=w-Appr-rt x1r=hround 2.75u; |
| 152 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 153 |
filldraw stroke z1e..z2e; penlabels(0,1,2); |
| 154 |
endchar; |
| 155 |
|
| 156 |
beginchar(main_name_with(_eqq_varnot), |
| 157 |
12u#+2appr#,v_center(spread2#+rth#+2spread1#)); |
| 158 |
"variant "&main_name_string&" but not equal-equal sign"; |
| 159 |
currentpicture:=tmp_picture; |
| 160 |
pickup tiny.nib; |
| 161 |
y0=math_axis-0.5(spread2); x0=0.5w; |
| 162 |
v_adjust(1r,2l,y0,3.5spread1-0.5rth); |
| 163 |
lft x2l-Appr=w-Appr-rt x1r=hround 2.25u; |
| 164 |
adjust_slanted_bar(2l,1r,2r,1l)(rth-tiny,-1); |
| 165 |
filldraw stroke z1e..z2e; penlabels(0,1,2); |
| 166 |
endchar; |
| 167 |
|
| 168 |
beginchar(main_name_with(_double), |
| 169 |
arithmetic_bounds); |
| 170 |
main_name_string&" double sign"; |
| 171 |
pickup tiny.nib; |
| 172 |
numeric a; a=0.5min(spread2,0.5(h+d-rth)); |
| 173 |
if main_name_string="subset": |
| 174 |
rt x1=rt x5=w-appr; rt x6=rt x10=w-Appr; |
| 175 |
y1-y5=4vround a; y6-y10=2vround a; |
| 176 |
y3=y8=0.5[y1,y5]=0.5[y6,y10]=math_axis; |
| 177 |
y2=y1; y4=y5; y7=y6; y9=y10; |
| 178 |
pos1(rth,90); pos2(rth,90); |
| 179 |
pos3(rth,180); pos4(rth,270); pos5(rth,270); |
| 180 |
pos6(rth,90); pos7(rth,90); |
| 181 |
pos8(rth,180); pos9(rth,270); pos10(rth,270); |
| 182 |
lft x3r=appr; x8-x3=hround a; |
| 183 |
x2=x4=x7=x9=1/3[x8,x6]; |
| 184 |
filldraw stroke z5e..z4e left_to_up |
| 185 |
z3e up_to_right z2e..z1e; |
| 186 |
filldraw stroke z10e..z9e left_to_up |
| 187 |
z8e up_to_right z7e..z6e; |
| 188 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 189 |
elseif main_name_string="supset": |
| 190 |
lft x1=lft x5=appr; lft x6=lft x10=Appr; |
| 191 |
y1-y5=4vround a; y6-y10=2vround a; |
| 192 |
y3=y8=0.5[y1,y5]=0.5[y6,y10]=math_axis; |
| 193 |
y2=y1; y4=y5; y7=y6; y9=y10; |
| 194 |
pos1(rth,90); pos2(rth,90); |
| 195 |
pos3(rth,0); pos4(rth,270); pos5(rth,270); |
| 196 |
pos6(rth,90); pos7(rth,90); |
| 197 |
pos8(rth,0); pos9(rth,270); pos10(rth,270); |
| 198 |
rt x3r=w-appr; x8-x3=-hround a; |
| 199 |
x2=x4=x7=x9=1/3[x8,x6]; |
| 200 |
filldraw stroke z1e..z2e right_to_down |
| 201 |
z3e down_to_left z4e..z5e; |
| 202 |
filldraw stroke z6e..z7e right_to_down |
| 203 |
z8e down_to_left z9e..z10e; |
| 204 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 205 |
elseif main_name_string="sqsubset": |
| 206 |
rt x1=rt x5=w-appr; rt x6=rt x10=w-Appr; |
| 207 |
y1-y5=4vround a; y6-y10=2vround a; |
| 208 |
y3=y8=0.5[y1,y5]=0.5[y6,y10]=math_axis; |
| 209 |
lft x3r=Appr; x8-x3=hround a; |
| 210 |
pos1(rth,90); pos3(rth,180); pos5(rth,270); |
| 211 |
pos6(rth,90); pos8(rth,180); pos10(rth,270); |
| 212 |
forsuffixes $=,r,l: x2$=x3$=x4$; y1$=y2$; y4$=y5$; |
| 213 |
x7$=x8$=x9$; y6$=y7$; y9$=y10$; endfor |
| 214 |
filldraw stroke z5e--z4e--z2e--z1e; |
| 215 |
filldraw stroke z10e--z9e--z7e--z6e; |
| 216 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 217 |
else: |
| 218 |
lft x1=lft x5=appr; lft x6=lft x10=Appr; |
| 219 |
y1-y5=4vround a; y6-y10=2vround a; |
| 220 |
y3=y8=0.5[y1,y5]=0.5[y6,y10]=math_axis; |
| 221 |
rt x3r=w-Appr; x8-x3=-hround a; |
| 222 |
pos1(rth,90); pos3(rth,0); pos5(rth,270); |
| 223 |
pos6(rth,90); pos8(rth,0); pos10(rth,270); |
| 224 |
forsuffixes $=,r,l: x2$=x3$=x4$; y1$=y2$; y4$=y5$; |
| 225 |
x7$=x8$=x9$; y6$=y7$; y9$=y10$; endfor |
| 226 |
filldraw stroke z1e--z2e--z4e--z5e; |
| 227 |
filldraw stroke z6e--z7e--z9e--z10e; |
| 228 |
penlabels(1,2,3,4,5,6,7,8,9,10); |
| 229 |
fi |
| 230 |
tmp_picture:=currentpicture; |
| 231 |
endchar; |
| 232 |
|
| 233 |
beginchar(main_name_with(_double_not), |
| 234 |
12u#+2appr#,asc_height#,asc_depth#); |
| 235 |
"not "&main_name_string&" double sign"; |
| 236 |
currentpicture:=tmp_picture; |
| 237 |
pickup tiny.nib; |
| 238 |
numeric a; a= |
| 239 |
if (main_name_string="subset") |
| 240 |
or (main_name_string="sqsubset"): - fi |
| 241 |
0.5min(spread2,0.5(h+d-rth)); |
| 242 |
pos1(rth,0); pos2(rth,0); |
| 243 |
v_adjust(1l,2l,math_axis,max(h+d,12u+spread1)); |
| 244 |
lft x1l=lft x2l=hround 0.5(w-0.5rth-0.5a); |
| 245 |
filldraw stroke z1e..z2e; penlabels(1,2); |
| 246 |
endchar; |
| 247 |
|
| 248 |
beginchar(main_name_with(_dot), |
| 249 |
12u#+2appr#,v_center(spread2#+rth#)); |
| 250 |
main_name_string&" with dot sign"; |
| 251 |
currentpicture:=tmp_picture; |
| 252 |
adjust_dot1((math_axis, |
| 253 |
if (main_name_string="subset") |
| 254 |
or (main_name_string="sqsubset"): w-appr-0.5dtsz |
| 255 |
else: appr+0.5dtsz fi),dtsz,true,false); |
| 256 |
dot(1,1'); |
| 257 |
endchar; |