summaryrefslogtreecommitdiff
path: root/fonts/utilities/mathinst/plainsty.tpl
blob: 425fef26c4f9f636055f71d208598a571231fb5a (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
## This is a template to use in the creation of a plain TeX
## style file.

sub by100{
  sprintf("%3.1f", $_[0] / 100);
}

$f = "\\f";

$A = <<"EndA";
\%\% This is a plain TeX macro file for using $fontfam_ fonts
\%\% together with $_[0] math fonts.

\%\% Created by MathInst$mathinstver_ on $today at $now.

\\input pdcfsel % get Damian Cugley's macros

\\newfam\\bifam 

\%\% Special purpose fonts and templates...

EndA
  &Out($A);

$mysize = &by100($ssSF_);
($ssr, $ssri, $ssb, $ssbi) = &deduce_family_members_from_font($sansserif_);
if ($ssb) {} else { # in case bold fonts are not detected, use regular
    $ssb=$ssr;
    $ssbi=$ssri;
}

  $B = <<"EndB";
\\def\\sanstemplate{%
  \\\@\\m{rm}{$ssr}\\\@${f}{it}{$ssri}%
  \\\@${f}{bf}{$ssb}\\\@${f}{bi}{$ssbi}%
}
\\fontset{sans}\\sanstemplate{$mysize}{12pt}{}{}
\\newfam\\sffam 
\\def\\sf{\\fam\\sffam\\sansrm}\\textfont\\sffam=\\sansrm % for math

EndB
if ($sansserif_) {
  &Out($B);
}

$mysize = &by100($ttSF_);
$C = <<"EndC";
\\def\\tttemplate{%
  \\\@${f}{rm}{$tt_}%
}
\\fontset{tt}\\tttemplate{$mysize}{12pt}{}{}
\\def\\tt{\\fam\\ttfam\\ttrm}\\textfont\\ttfam = \\ttrm % for math

EndC
if (tt_) {
  &Out($C);
}

$mysize = &by100($caSF_);
$D = <<"EndD";
\\def\\caltemplate{
  \\\@${f}{rm}{$cal_}%
}
\\fontset{cal}\\caltemplate{$mysize}{12pt}{}{}
\\newfam\\calfam
\\def\\cal{\\fam\\calfam\\calrm}\\textfont\\calfam = \\calrm % for math

EndD
if ($cal_) {
  &Out($D);
}

$mysize = &by100($frSF_);
$E = <<"EndE";
\\def\\fraktemplate{
  \\\@${f}{rm}{$fraktur_}%
}
\\fontset{frak}\\fraktemplate{$mysize}{12pt}{}{}
\\newfam\\frakfam
\\def\\frak{\\fam\\frakfam\\frakrm}\\textfont\\frakfam = \\frakrm % for math

EndE
if ($fraktur_) {
  &Out($E);
} 

$mysize = &by100($bbSF_);
$F = <<"EndF";
\\def\\bbtemplate{
  \\\@${f}{rm}{$bbold_}%
}
\\fontset{bb}\\bbtemplate{$mysize}{12pt}{}{}
\\newfam\\bbfam
\\def\\bb{\\fam\\bbfam\\bbrm}\\textfont\\bbfam = \\bbrm % for math

EndF
if ($bbold_) {
  &Out($F);
}

local(@m) = ($nfssvar, $nfssvar, $nfssvar);	# default
@m = ("${mathid}7t", "${mathid}7t7", "${mathid}7t5")
  if &isvariable($greekbold_);
$G = <<"EndG";
%% Now for the usual stuff, math and roman.

\\font\\tenex=${fontfam_}${rreg}${mathid}7v at 10 pt
\\textfont3=\\tenex \\scriptfont3=\\tenex \\scriptscriptfont3=\\tenex

\\def\\texttemplate{%
  \\\@${f}{textrm}{${fontfam_}${rreg}${nfssvar}}% 
  \\\@\\M{rm}{${fontfam_}${rreg}${mathid}7t}\\\@\\M{mi}{${fontfam_}${rreg}${mathid}7m}%
  \\\@\\M{sy}{${fontfam_}${rreg}${mathid}7y}% math fonts
  \\\@\\M{it}{${fontfam_}${rreg}$rit${nfssvar}}\\\@\\m{bf}{${fontfam_}$rbold$m[0]}%
  \\\@${f}{bi}{${fontfam_}${rbold}$rit${nfssvar}}}%
\\def\\scripttemplate{%
  \\\@\\M{rm}{${fontfam_}${rreg}${mathid}7t7}\\\@\\M{mi}{${fontfam_}${rreg}${mathid}7m7}%
  \\\@\\M{sy}{${fontfam_}${rreg}${mathid}7y7}% math fonts
  \\\@\\M{it}{${fontfam_}${rreg}$rit${nfssvar}}\\\@\\m{bf}{${fontfam_}$rbold$m[1]}%
  \\\@${f}{bi}{${fontfam_}${rbold}$rit${nfssvar}}}%
\\def\\sscripttemplate{%
  \\\@\\M{rm}{${fontfam_}${rreg}${mathid}7t5}\\\@\\M{mi}{${fontfam_}${rreg}${mathid}7m5}%
  \\\@\\M{sy}{${fontfam_}${rreg}${mathid}7y5}% math fonts
  \\\@\\M{it}{${fontfam_}${rreg}$rit${nfssvar}}\\\@\\m{bf}{${fontfam_}$rbold$m[2]}%
  \\\@${f}{bi}{${fontfam_}${rbold}$rit${nfssvar}}}%
\\xfontset{scriptscript}\\sscripttemplate{5}
\\xfontset{script}\\scripttemplate{7}
\\fontset{body}\\texttemplate{10}{12pt}{script}{scriptscript}
\\fontset{heading}\\texttemplate{12}{14pt}{body}{script}
\\fontset{note}\\scripttemplate{8}{10pt}{scriptscript}{scriptscript}

%% Some miscellaneous hacks...

\\def\\l{\\char170\\relax}\\def\\L{\\char138\\relax}

\\catcode`\\\@=11 
  \\setbox0=\\hbox{\\tenex B}\\p\@renwd=\\wd0 % for \\bordermatrix
\\catcode`\\\@=12
EndG
&Out($G);
$H = <<"EndH";
\\mathchardef\\varkappa="0180
\\mathchardef\\comp="2181
\\def\\vec{\\mathaccent"717E }
\\mathchardef\\Relbar="3280
\\mathcode`\\;="6281
EndH
&Out($H) if $_[0] eq "mt";
&Out("\\def\\joinrel{\\mathrel{\\mkern-4mu}}") if $_[0] eq "lu";
&Out("\\bodyfonts");
&Out("%% Assigning skewchars...");
&Out("\\skewchar\\bodymi=127 \\skewchar\\scriptmi=127 \\skewchar\\scriptscriptmi=127");
&Out("\\skewchar\\bodysy=48  \\skewchar\\scriptsy=48  \\skewchar\\scriptscriptmi=48");
&Out("\n\\let\\tenrm=\\textrm \\textrm\n\n\\endinput");
1;