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
|
%D \module
%D [ file=core-pos,
%D version=2006.09.18,
%D title=\CONTEXT\ Core Macros,
%D subtitle=Positioning Support,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\unprotect
\registerctxluafile{core-pos}{1.001}
\appendtoks
\immediatewriteutilitytua{if not job.positions then job.positions = { } end}%
\immediatewriteutilitytua{local jp = job.positions}%
\to \everyopenutilities
\def\replacepospxywhd#1#2#3#4#5#6#7%
{\ctxlua{job.positions['#1']={\number#2,"\the\dimexpr#3\relax","\the\dimexpr#4\relax",%
"\the\dimexpr#5\relax","\the\dimexpr#6\relax","\the\dimexpr#7\relax"}}}
\def\dolazysaveposition#1#2#3#4%
{\expanded{\writeutilitytua{jp['#1']={#2,"#3","#4"}}}}
\def\dolazysavepositionwhd#1#2#3#4#5#6#7%
{\expanded{\writeutilitytua{jp['#1']={#2,"#3","#4","#5","#6","#7"}}}}
\def\dolazysavepositionplus#1#2#3#4#5#6#7#8%
{\expanded{\writeutilitytua{jp['#1']={#2,"#3","#4","#5","#6","#7","#8"}}}}
\def\dosaveposition#1#2#3#4% tag page x y
{\expanded{\immediatewriteutilitytua{jp['#1']={#2,"#3","#4"}}}}
\def\dosavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
{\expanded{\immediatewriteutilitytua{jp['#1']={#2,"#3","#4","#5","#6","#7"}}}}
\def\dosavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
{\expanded{\immediatewriteutilitytua{jp['#1']={#2,"#3","#4","#5","#6","#7","#8"}}}}
\def\MPp #1{\ctxlua{job.MPp("#1")}}
\def\MPx #1{\ctxlua{job.MPx("#1")}}
\def\MPy #1{\ctxlua{job.MPy("#1")}}
\def\MPw #1{\ctxlua{job.MPw("#1")}}
\def\MPh #1{\ctxlua{job.MPh("#1")}}
\def\MPd #1{\ctxlua{job.MPd("#1")}}
\def\MPxy #1{\ctxlua{job.MPxy("#1")}}
\def\MPll #1{\ctxlua{job.MPll("#1")}}
\def\MPlr #1{\ctxlua{job.MPlr("#1")}}
\def\MPur #1{\ctxlua{job.MPur("#1")}}
\def\MPul #1{\ctxlua{job.MPul("#1")}}
\def\MPpos#1{\ctxlua{job.MPpos("#1")}}
\def\MPplus#1#2#3{\ctxlua{job.MPplus("#1",#2,"#3")}}
\def\MPrest #1#2{\ctxlua{job.MPrest("#1","#2")}}
\def\doifpositionelse#1{\ctxlua{cs.testcase(job.positions['#1'])}}
\def\copyposition#1#2{\ctxlua{job.positions['#1']=job.positions['#2']}}
\protect \endinput
|