math-mps.mkxl /size: 1592 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [       file=math-mps,
3%D        version=2024.06.02,
4%D          title=\CONTEXT\ Math Macros,
5%D       subtitle=MathFun,
6%D         author={Hans Hagen & Mikael Sundqvist},
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE & \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Math Macros / MathFun}
15
16\unprotect
17
18%D These mp plugins started out as gimmick but might as well evolve into a more
19%D grown up mechanism. It will take a while to have plgins for all the extensibles,
20%D then we will look at the shapes. It makes no sense to have all shapes done this
21%D way.
22%D
23%D You can load some demo plugins with:
24%D
25%D \starttyping
26%D \usemathpluginlibrary[demo]
27%D \stoptyping
28%D
29%D You can process \type {math-mps-imp-demo.mkxl} to get an idea of how this works.
30
31\registerctxluafile{math-mps}{autosuffix}
32
33\protected\def\math_extensible_mp#1#2#3#4#5#6#7#8%
34  {\begingroup
35   \d_overlay_width       #2\scaledpoint
36   \d_overlay_height      #3\scaledpoint
37   \d_overlay_depth       #4\scaledpoint
38   \d_overlay_linewidth   #5\scaledpoint
39   \d_overlay_mathaxis    #6\scaledpoint
40   \d_overlay_mathexheight#7\scaledpoint
41   \d_overlay_mathemwidth #8\scaledpoint
42   %
43   \d_overlay_offset     \zeropoint
44   %
45   \obeyMPboxdepth
46   \global\setbox\globalscratchbox\hpack\bgroup
47      \useMPgraphic{#1}% {...}
48   \egroup
49   \endgroup}
50
51% \permanent\protected\def\usemathpluginlibrary[#1]{\clf_usemathpluginlibrary{#1}}
52
53\protect
54