summaryrefslogtreecommitdiff
path: root/tex/context/base/math-pln.mkiv
blob: b862bb4cb4057a20de37931c24ba396024edd111 (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
%D \module
%D   [       file=math-pln,
%D        version=2001.11.16,
%D          title=\CONTEXT\ Math Macros,
%D       subtitle=Plain Helpers,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D Here we collect some Plain \TEX\ leftovers.

\writestatus{loading}{ConTeXt Math Macros / Plain Helpers}

\unprotect

% we need proper unicode:

\def\relbar{\mathrel{\smash-}} % - has the same height as + .. no clue what this refers to

% might change

\unexpanded\def\hrulefill{\leaders\hrule\hfill}
\unexpanded\def\dotfill  {\cleaders\hbox{$\mathsurround\zeropoint\mkern1.5mu.\mkern1.5mu$}\hfill}

% will move

\def\oalign#1%
  {\leavevmode
   \vtop
     {\baselineskip\zeroskip
      \lineskip.25\exheight
      \ialign{##\crcr#1\crcr}}}

\def\ooalign % chars over each other
  {\lineskiplimit-\maxdimen
   \oalign}

% needs checking

\def\choose{\atopwithdelims()}
\def\brack {\atopwithdelims[]}
\def\brace {\atopwithdelims\{\}}

% needs checking

\unexpanded\def\buildrel#1\over#2%
  {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}

\unexpanded\def\bmod
  {\nonscript
   \mskip-\medmuskip
   \mkern5mu
   \mfunction{mod}%
   \penalty900
   \mkern5mu
   \nonscript
   \mskip-\medmuskip}

\unexpanded\def\pmod#1%
  {\allowbreak
   \mkern18mu
   (\mfunction{mod}\mskip\medmuskip#1)}

\unexpanded\def\cases#1%
  {\left\{%
   \mskip\thinmuskip
   \vcenter
     {\normalbaselines
      \mathsurround\zeropoint
      \ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}%
   \right.}

\unexpanded\def\matrix#1%
  {\emptyhbox
   \mskip\thinmuskip
   \vcenter
     {\normalbaselines\mathsurround\zeropoint
      \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
      \mathstrut\crcr\noalign{\kern-\baselineskip}
      #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}%
   \mskip\thinmuskip}

\unexpanded\def\pmatrix#1%
  {\left(\matrix{#1}\right)}

\unexpanded\def\openup
  {\afterassignment\math_openup\scratchdimen=}

\def\math_openup
  {\advance\lineskip     \scratchdimen
   \advance\baselineskip \scratchdimen
   \advance\lineskiplimit\scratchdimen}

\unexpanded\def\displaylines#1%
  {\the\mathdisplayaligntweaks
   \tabskip\zeroskip
   \halign
     {\hbox to \displaywidth{$\tabskip\zeroskip\everycr\emptytoks\hfil\displaystyle##\hfil$}\crcr
      #1\crcr}}

\protect \endinput