summaryrefslogtreecommitdiff
path: root/systems/knuth/dist/lib/mftmac.tex
blob: 3243e74d68db7ae3f05c3e836e2c11c32903f301 (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
% special macros for use with MFT output

\font\tenlogo=logo10 % font used for the METAFONT logo
\font\tentex=cmtex10 \hyphenchar\tentex=-1 % font used for strings
\font\sevenit=cmti7  \scriptfont\itfam=\sevenit
\def\MF{{\tenlogo META}\-{\tenlogo FONT}}

\parindent=0pt
\thinmuskip=5mu
\thickmuskip=6mu plus 6mu
\mathcode`\|="326A

\def\\#1{{\it#1}} % italic type for identifiers
\def\0#1#2#3{\hbox{\rm\'{}\kern-.2em\it#1#2#3\/\kern.05em}} % octal constant
\def\1#1{\mathop{\hbox{\rm#1}}} % operator, in roman type
\def\2#1{\mathop{\hbox{\bf#1\/\kern.05em}}} % operator, in bold type
\def\3#1{\,\mathclose{\hbox{\bf#1\/}}} % `fi' and `endgroup'
\def\4#1{\mathbin{\hbox{\bf#1\/}}} % `step' and `at'
\def\5#1{\hbox{\bf#1\/}} % `true' and `nullpicture'
\def\6#1{\mathbin{\rm#1}} % `++' and `scaled'
\def\7{\hbox\bgroup\nocats\frenchspacing\finstring} % string token
\def\8#1{\mathrel{\mathcode`\.="8000 \mathcode`\-="8000
  #1\unkern}} % `..' and `--'
\def\9{\hfill$\%} % comment separator
\def\?#1{\mathopen{#1}\;} % `:', `::', and `||:'
\def\frac#1/#2{\leavevmode\kern.1em
  \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
  /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}

\mathchardef\AM="2026 % ampersand
\let\BL=\medskip % space for empty line
\mathchardef\BS="026E %  backslash
\mathchardef\HA="0222 % hat ("005E not as good)
\def\PS{\mathbin{+{-}+}} % pythagorean subtraction
\def\SH{\raise.7ex\hbox{$\scriptstyle\#$}} % sharp sign for sharped units
\mathchardef\TI="007E % tilde

\chardef\other=12
\def\nocats{\catcode`\\=\other \catcode`\{=\other
  \catcode`\}=\other \catcode`\$=\other \catcode`\&=\other
  \catcode`\#=\other \catcode`\%=\other \catcode`\~=\other
  \catcode`\_=\other \catcode`\^=\other}
\def\finstring"#1"{\tentex"#1"\egroup}

\newbox\shorthyf \setbox\shorthyf=\hbox{-\kern-.05em}
\mathchardef\period=`\.
{\catcode`\-=\active \global\def-{\copy\shorthyf\mkern3.9mu}
 \catcode`\.=\active \global\def.{\period\mkern3mu}}

\def\bf{\fam\bffam
  \def\_{\kern.04em\vbox{\hrule width.3em height .6pt}\kern.08em}%
  \tenbf}

\def\join#1${} % say %%\join in .mf file to join lines together
\def\]{\hskip0pt plus 1filll\ } % say % comment\] to get comment flush left