1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Anchoring Macros Local Positioning}
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30\registerctxluafile{anchloc}{autosuffix}
31
32\unprotect
33
34\aliased\let\syncanchor \gobblethreearguments
35\aliased\let\alignanchor\gobblefourarguments
36\aliased\let\markanchor \gobblethreearguments
37
38\permanent\protected\def\anch_local_withanchor_s #1#2#3{\leftboundary\setlocalsyncanchor {#1} #2 #3\rightboundary}
39\permanent\protected\def\anch_local_withanchor_a#1#2#3#4{\leftboundary\setlocalalignanchor{#1} #2 #3{#4}\rightboundary}
40\permanent\protected\def\anch_local_withanchor_n #1#2#3{\leftboundary\setlocalmarkanchor {#1} #2 #3\rightboundary}
41\permanent\protected\def\anch_local_withanchor_t #1#2#3{\anch_local_withanchor_n{#1}{#2}{#3}\smash[whd]{\smallinfofont\number#2\number#3}}
42
43\permanent\protected\def\setlocalanchoring
44 {\enforced\let\syncanchor \anch_local_withanchor_s
45 \enforced\let\alignanchor\anch_local_withanchor_a
46 \enforced\let\markanchor \anch_local_withanchor_m}
47
48\let\anch_local_withanchor_m\anch_local_withanchor_n
49
50\installtextracker{localanchor}
51 {\let\anch_local_withanchor_m\anch_local_withanchor_t}
52 {\let\anch_local_withanchor_m\anch_local_withanchor_n}
53
54\permanent\protected\lettonothing\stopanchoring
55
56\permanent\protected\def\startanchoring#1\stopanchoring
57 {\begingroup
58 \pushlocalanchors
59 \setlocalanchoring
60 \setbox\scratchbox\vbox{\settrialtypesetting#1}
61 \analyzelocalanchors\scratchbox
62 \vbox{#1}
63 \poplocalanchors
64 \endgroup}
65
66\permanent\protected\lettonothing\stopsynchronizing
67
68\permanent\protected\def\startsynchronizing#1\stopsynchronizing
69 {\begingroup
70 \pushlocalanchors
71 \setlocalanchoring
72 \setbox\scratchbox\vbox{#1}
73 \synchronizelocalanchors\scratchbox
74 \unvbox\scratchbox
75 \poplocalanchors
76 \endgroup}
77
78
79
80\permanent\protected\def\autosync#1#2{\leftboundary\sync{#1}{#2}\rightboundary}
81
82
83
84
85
86
87
88
89
90\permanent\protected\def\mathsync#1{\sync{m}{#1}}
91\permanent\protected\def\mordsync#1{\mathord{}\sync{m}{#1}}
92\permanent\protected\def\mrelsync#1{\mathrel{}\sync{m}{#1}}
93\permanent\protected\def\mbinsync#1{\mathbin{}\sync{m}{#1}}
94
95\setlocalanchoring
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113\protect \endinput
114
115
116 |