summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fonts/enc/dvips/context/ec-2004.enc82
-rw-r--r--metapost/context/base/mp-chem.mp38
-rw-r--r--tex/context/base/chem-str.lua2
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/enco-ini.mkii2
-rw-r--r--tex/context/base/enco-l7x.mkii236
-rw-r--r--tex/context/base/lpdf-ano.lua19
-rw-r--r--tex/context/base/node-fin.mkiv2
-rw-r--r--tex/context/base/ppchtex.mkii101
-rw-r--r--tex/context/base/ppchtex.mkiv103
-rw-r--r--tex/context/base/strc-des.mkiv36
-rw-r--r--tex/context/base/strc-lst.lua40
-rw-r--r--tex/context/base/strc-lst.mkiv25
-rw-r--r--tex/context/base/strc-ref.lua34
-rw-r--r--tex/context/base/strc-ref.mkiv56
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
17 files changed, 718 insertions, 64 deletions
diff --git a/fonts/enc/dvips/context/ec-2004.enc b/fonts/enc/dvips/context/ec-2004.enc
new file mode 100644
index 000000000..f092a34a2
--- /dev/null
+++ b/fonts/enc/dvips/context/ec-2004.enc
@@ -0,0 +1,82 @@
+%
+% This is the EC encoding.
+%
+% These are the ligs and kerns in addition to those found in the
+% AFM file. (The only ligs in the Times-Roman.afm file are the
+% fi and fl ligatures.)
+%
+% LIGKERN space l =: lslash ; space L =: Lslash ;
+% LIGKERN question quoteleft =: questiondown ; exclam quoteleft =: exclamdown ;
+% LIGKERN hyphen hyphen =: endash ; endash hyphen =: emdash ;
+% LIGKERN quoteleft quoteleft =: quotedblleft ;
+% LIGKERN quoteright quoteright =: quotedblright ;
+%
+% We blow away kerns to and from spaces (TeX doesn't have a
+% space) and also remove any kerns from the numbers (although
+% the only kern pair that mentions a number in Times-Roman.afm
+% is one one.)
+%
+% LIGKERN space {} * ; * {} space ; zero {} * ; * {} zero ;
+% LIGKERN one {} * ; * {} one ; two {} * ; * {} two ;
+% LIGKERN three {} * ; * {} three ; four {} * ; * {} four ;
+% LIGKERN five {} * ; * {} five ; six {} * ; * {} six ;
+% LIGKERN seven {} * ; * {} seven ; eight {} * ; * {} eight ;
+% LIGKERN nine {} * ; * {} nine ;
+% LIGKERN comma comma =: quotedblbase ; less less =: guillemotleft ;
+% LIGKERN greater greater =: guillemotright ;
+%
+/ECEncoding [ % now 256 chars follow
+% 0x00
+ /grave /acute /circumflex /tilde /dieresis /hungarumlaut /ring /caron
+ /breve /macron /dotaccent /cedilla
+ /ogonek /quotesinglbase /guilsinglleft /guilsinglright
+% 0x10
+ /quotedblleft /quotedblright /quotedblbase /guillemotleft
+ /guillemotright /endash /emdash /cwm
+ /zeroinferior /dotlessi /dotlessj /ff /fi /fl /ffi /ffl
+% 0x20
+ /visualspace /exclam /quotedbl /numbersign
+ /dollar /percent /ampersand /quoteright
+ /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
+% 0x30
+ /zero /one /two /three /four /five /six /seven
+ /eight /nine /colon /semicolon /less /equal /greater /question
+% 0x40
+ /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O
+% 0x50
+ /P /Q /R /S /T /U /V /W
+ /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+% 0x60
+ /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o
+% 0x70
+ /p /q /r /s /t /u /v /w
+ /x /y /z /braceleft /bar /braceright /asciitilde /hyphen
+% 0x80
+ /Abreve /Aogonek /Cacute /Ccaron /Dcaron /Ecaron /Eogonek /Gbreve
+ /Lacute /Lcaron /Lslash /Nacute /Ncaron /Ng /Ohungarumlaut /Racute
+% 0x90
+ /Rcaron /Sacute /Scaron /Scedilla
+ /Tcaron /Tcedilla /Uhungarumlaut /Uring
+ /Ydieresis /Zacute /Zcaron /Zdotaccent /IJ /Idotaccent /dbar /section
+% 0xA0
+ /abreve /aogonek /cacute /ccaron /dcaron /ecaron /eogonek /gbreve
+ /lacute /lcaron /lslash /nacute /ncaron /ng /ohungarumlaut /racute
+% 0xB0
+ /rcaron /sacute /scaron /scedilla
+ /tquoteright /tcedilla /uhungarumlaut /uring
+ /ldot /zacute /zcaron /zdotaccent /ij /exclamdown /questiondown /sterling
+% 0xC0
+ /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+ /Egrave /Eacute /Ecircumflex /Edieresis
+ /Igrave /Iacute /Icircumflex /Idieresis
+% 0xD0
+ /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /OE
+ /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /Germandbls
+% 0xE0
+ /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+ /egrave /eacute /ecircumflex /edieresis
+ /igrave /iacute /icircumflex /idieresis
+% 0xF0
+ /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /oe
+ /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /germandbls
+] def
diff --git a/metapost/context/base/mp-chem.mp b/metapost/context/base/mp-chem.mp
index e04fcd350..fa0d5fabf 100644
--- a/metapost/context/base/mp-chem.mp
+++ b/metapost/context/base/mp-chem.mp
@@ -51,6 +51,7 @@ path
chem_sb_path[], chem_msb_path[], chem_psb_path[],
chem_s_path[], chem_ss_path[], chem_mss_path[], chem_pss_path[],
chem_e_path[], chem_sd_path[], chem_bb_path[], chem_oe_path[],
+ chem_bd_path[], chem_bw_path[],
chem_ddt_path[], chem_ddb_path[], chem_ldt_path[], chem_ldb_path[], chem_rdt_path[], chem_rdb_path[],
chem_dbl_path[], chem_dbr_path[],
chem_ad_path[], chem_au_path[],
@@ -83,6 +84,8 @@ chem_doing_pb := false ;
chem_shift := origin ;
chem_dot_factor := 4 ;
chem_text_trace := false ;
+chem_bd_n := 4 ;
+chem_bw_n := 4 ;
vardef chem_start_structure(expr n, l, r, t, b, scale, axis, fixedwidth, fixedheight, offset) =
chem_setting_axis := axis ;
@@ -348,6 +351,14 @@ enddef ;
vardef chem_oe (expr n, f, t, r, c) = % one
chem_draw (n, chem_oe_path[n], f, t, r, c) ;
enddef ;
+vardef chem_bd (expr n, f, t, r, c) = % one
+ for i=0 upto 5 :
+ chem_draw (n, subpath (2i,2i+1) of chem_bd_path[n], f, t, r, c) ;
+ endfor ;
+enddef ;
+vardef chem_bw (expr n, f, t, r, c) = % one
+ chem_draw (n, chem_bw_path[n], f, t, r, c) ;
+enddef ;
vardef chem_z_zero@#(text t) =
chem_text@#(t, chem_do(origin)) ;
@@ -683,7 +694,7 @@ enddef ;
def chem_init_five_front = chem_init_some_front(-5,30/35,72,0,2,0) ; enddef ; % 36
def chem_init_six_front = chem_init_some_front(-6, 1 ,60,0,2,0) ; enddef ; % 30
-def chem_init_one =
+vardef chem_init_one =
chem_width [1] := .75 * chem_base_width * chem_setting_scale ;
chem_angle [1] := 45 ;
chem_start [1] := 0 ;
@@ -707,14 +718,31 @@ def chem_init_one =
chem_ldb_path [1] := chem_ddb_path [1] shifted (0,-.1chem_width[1]) ;
chem_rdt_path [1] := chem_ddt_path [1] shifted (0, .1chem_width[1]) ;
chem_rdb_path [1] := chem_ddb_path [1] shifted (0, .1chem_width[1]) ;
- chem_bb_path [1] := point 0 of chem_r_path[1] --
- point 1 of chem_r_path[1] rotatedaround(point 0 of chem_r_path[1], -4) --
- point 1 of chem_r_path[1] rotatedaround(point 0 of chem_r_path[1], 4) -- cycle ;
+ save pr ; pair pr[] ;
+ pr0 := point 0 of chem_r_path[1] ;
+ pr1 := point 1 of chem_r_path[1] ;
+ chem_bb_path [1] := point 0 of chem_r_path[1] -- pr1 rotatedaround(pr0, -4) -- pr1 rotatedaround(pr0, 4) -- cycle ;
chem_oe_path [1] := ((-20,0)--(10,0){up}..(20,10)..(30,0)..(40,-10)..(50.0,0)..(60,10)..(70,0)..(80,-10)..{up}(90,0)--(120,0))
- xsized (.75*chem_width[1]) shifted point 0 of chem_r_path[1] ;
+ xsized (.75*chem_width[1]) shifted pr0 ;
chem_rt_zero [1] := point .5 of chem_r_path[1] ;
chem_rtt_zero [1] := chem_rt_zero[1] rotated + (chem_angle[1]/2) ;
chem_rbt_zero [1] := chem_rt_zero[1] rotated - (chem_angle[1]/2) ;
+ % added by Alan Braslau (adapted to use shared variables):
+ save p ; pair p[] ;
+ p0 := pr1 rotatedaround(pr0, -4) ;
+ p1 := pr1 rotatedaround(pr0, +4) ;
+ p2 := p0 shifted - pr1 ;
+ p3 := p1 shifted - pr1 ;
+ chem_bd_path [1] :=
+ p0 -- p1 for i=chem_bd_n downto 0 :
+ -- p2 shifted (i/chem_bd_n)[pr1,pr0]
+ -- p3 shifted (i/chem_bd_n)[pr1,pr0]
+ endfor ;
+ chem_bw_path [1] :=
+ for i=0 upto chem_bw_n - 1 :
+ ((i) /chem_bw_n)[pr0,pr1] .. ((i+.25)/chem_bw_n)[pr0,pr1] shifted p2 ..
+ ((i+.50)/chem_bw_n)[pr0,pr1] .. ((i+.75)/chem_bw_n)[pr0,pr1] shifted -p2 ..
+ endfor pr1 ;
enddef ;
def chem_init_all =
diff --git a/tex/context/base/chem-str.lua b/tex/context/base/chem-str.lua
index 02fc585fc..8dc073d49 100644
--- a/tex/context/base/chem-str.lua
+++ b/tex/context/base/chem-str.lua
@@ -60,7 +60,7 @@ local one_keys = {
sb = "line", db = "line", tb = "line",
ep = "line", es = "line", ed = "line", et = "line",
sd = "line", ldd = "line", rdd = "line",
- hb = "line", bb = "line", oe = "line",
+ hb = "line", bb = "line", oe = "line", bd = "line", bw = "line",
z = "text", cz = "text", zt = "text", zn = "number",
zbt = "text", zbn = "number", ztt = "text", ztn = "number",
mov = "transform", sub = "transform", dir = "transform", off = "transform",
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 3b7f2743c..6db8e683e 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2010.01.22 19:05}
+\newcontextversion{2010.01.25 11:09}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 70b45aa64..3f7110d53 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2010.01.22 19:05}
+\edef\contextversion{2010.01.25 11:09}
%D For those who want to use this:
diff --git a/tex/context/base/enco-ini.mkii b/tex/context/base/enco-ini.mkii
index 1ac491e62..33825f94d 100644
--- a/tex/context/base/enco-ini.mkii
+++ b/tex/context/base/enco-ini.mkii
@@ -1129,7 +1129,7 @@
\ifnum\texengine=\xetexengine
\setupencoding[\s!default=\s!default]
\else
- \useencoding[ans,il2,ec,tbo,pdf,pol,qx,t5,cyr,agr] % pol and il2 will go away, not needed in mkiv, uc removed
+ \useencoding[ans,il2,ec,tbo,pdf,pol,qx,t5,l7x,cyr,agr] % pol and il2 will go away, not needed in mkiv, uc removed
\useencoding[032,033,037] % fallbacks for some unicode chars
\setupencoding[\s!default=ec] % was: [\s!default=\s!default]
\fi
diff --git a/tex/context/base/enco-l7x.mkii b/tex/context/base/enco-l7x.mkii
new file mode 100644
index 000000000..8f355317b
--- /dev/null
+++ b/tex/context/base/enco-l7x.mkii
@@ -0,0 +1,236 @@
+%D \module
+%D [ file=enco-l7x,
+%D version=2010.01.22,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=\LATEX\ L7x Encoding,
+%D author={Hans Hagen \& Mojca Miklavec},
+%D date=\currentdate,
+%D copyright=PRAGMA-ADE]
+%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 Encoding vector to support Latvian and Lithuanian. The first
+%D part is taken from EC encoding, the rest has not been tested
+%D extensively.
+
+\startmapping[l7x]
+
+\definecaseswap 25 `I % dotless i (TODO - probably wrong; maybe use \defineuppercasecom)
+\definecaseswap 156 140 % oeligature
+\definecaseswap 184 168 % ostroke
+\definecaseswap 186 170 % rcommaaccent
+\definecaseswap 191 175 % aeligature
+\definecaseself 223 % ssharp (this is wrong, but no better way)
+
+\definecasemaps 192 to 222 lc +32 uc 0
+\definecasemaps 224 to 254 lc 0 uc -32
+\resetcaserange 215 to 215 % textmultiply
+\resetcaserange 247 to 247 % textdiv
+
+\stopmapping
+
+\startencoding[l7x]
+
+\definecharacter textgrave 0
+\definecharacter textacute 1
+\definecharacter textcircumflex 2
+\definecharacter texttilde 3
+\definecharacter textdiaeresis 4
+\definecharacter texthungarumlaut 5
+\definecharacter textring 6
+\definecharacter textcaron 7
+\definecharacter textbreve 8
+\definecharacter textmacron 9
+\definecharacter textdotaccent 10
+\definecharacter textcedilla 11
+\definecharacter textogonek 12
+\definecharacter quotesinglebase 13
+\definecharacter guilsingleleft 14
+\definecharacter guilsingleright 15
+\definecharacter quotedblleft 16
+\definecharacter quotedblright 17
+\definecharacter quotedblbase 18
+\definecharacter leftguillemot 19
+\definecharacter rightguillemot 20
+\definecharacter endash 21
+\definecharacter emdash 22
+%definecharacter compoundwordmark 23
+%definecharacter perthousand 24
+\definecharacter dotlessi 25 % or when missing: {j}
+\definecharacter dotlessj 26
+% ff 27
+% fi 28
+% fl 29
+% ffi 30
+% ffl 31
+%definecharacter textvisiblespace 32
+% exclam ! 33
+\definecharacter quotedbl 34
+% numbersign # 35
+% dollar $ 36
+\definecharacter percent 37
+% ampersand & 38
+%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!!
+\definecharacter quoteright 39
+% parenleft ( 40
+% parenright ) 41
+% asterisk * 42
+% plus + 43
+% comma , 44
+\definecharacter softhyphen 45
+% period . 46
+% slash / 47
+% 0-9 48-57
+% colon : 58
+% semicolon ; 59
+% less < 60
+% equal = 61
+% greater > 62
+% question ? 63
+% at @ 64
+% A-Z 65-90
+% bracketleft [ 91
+\definecharacter textbackslash 92
+% bracketright ] 93
+\definecharacter textasciicircum 94
+\definecharacter textunderscore 95
+\definecharacter quoteleft 96
+% a-z 97-122
+\definecharacter textbraceleft 123
+\definecharacter textbraceright 125
+\definecharacter textasciitilde 126
+% .notdef 127
+\definecharacter texteuro 128
+% .notdef 129
+\definecharacter quotesinglebase 130
+\definecharacter textflorin 131 \definecharacter fhook 131
+\definecharacter quotedblbase 132
+\definecharacter textellipsis 133
+\definecharacter textdag 134
+\definecharacter textddag 135
+% .notdef 136
+\definecharacter perthousand 137
+% .notdef 138
+\definecharacter guilsingleleft 139
+\definecharacter OEligature 140 % TODO: also \OE???
+\definecharacter textdiaeresis 141
+\definecharacter textcaron 142
+\definecharacter textcedilla 143
+% .notdef 144
+\definecharacter quoteleft 145
+\definecharacter quoteright 146
+\definecharacter quotedblleft 147
+\definecharacter quotedblright 148
+\definecharacter textbullet 149
+\definecharacter endash 150
+\definecharacter emdash 151
+% .notdef 152
+\definecharacter trademark 153
+% .notdef 154
+\definecharacter guilsingleright 155
+\definecharacter oeligature 156
+\definecharacter textmacron 157
+\definecharacter textogonek 158
+% .notdef 159
+%definecharacter space 160 % TODO!!!
+\definecharacter quotedblright 161
+\definecharacter textcent 162
+\definecharacter textsterling 163
+\definecharacter textcurrency 164
+\definecharacter quotedblbase 165
+\definecharacter textbrokenbar 166
+\definecharacter sectionmark 167
+\definecharacter Ostroke 168
+\definecharacter copyright 169
+\definecharacter Rcommaaccent 170
+\definecharacter leftguillemot 171
+\definecharacter textlognot 172
+%definecharacter softhyphen 173 % -> 45 (TODO!!!)
+\definecharacter registered 174
+\definecharacter AEligature 175
+\definecharacter textdegree 176
+\definecharacter textpm 177
+\definecharacter twosuperior 178
+\definecharacter threesuperior 179
+\definecharacter quotedblleft 180
+\definecharacter textmu 181
+\definecharacter paragraphmark 182
+\definecharacter periodcentered 183
+\definecharacter ostroke 184
+\definecharacter onesuperior 185
+\definecharacter rcommaaccent 186
+\definecharacter rightguillemot 187
+\definecharacter onequarter 188
+\definecharacter onehalf 189
+\definecharacter threequarter 190
+\definecharacter aeligature 191
+\definecharacter Aogonek 192
+\definecharacter Iogonek 193
+\definecharacter Amacron 194
+\definecharacter Cacute 195
+\definecharacter Adiaeresis 196
+\definecharacter Aring 197
+\definecharacter Eogonek 198
+\definecharacter Emacron 199
+\definecharacter Ccaron 200
+\definecharacter Eacute 201
+\definecharacter Zacute 202
+\definecharacter Edotaccent 203
+\definecharacter Gcommaaccent 204
+\definecharacter Kcommaaccent 205
+\definecharacter Imacron 206
+\definecharacter Lcommaaccent 207
+\definecharacter Scaron 208
+\definecharacter Nacute 209
+\definecharacter Ncommaaccent 210
+\definecharacter Oacute 211
+\definecharacter Omacron 212
+\definecharacter Otilde 213
+\definecharacter Odiaeresis 214
+\definecharacter textmultiply 215
+\definecharacter Uogonek 216
+\definecharacter Lstroke 217
+\definecharacter Sacute 218
+\definecharacter Umacron 219
+\definecharacter Udiaeresis 220
+\definecharacter Zdotaccent 221
+\definecharacter Zcaron 222
+\definecharacter ssharp 223
+\definecharacter aogonek 224
+\definecharacter iogonek 225
+\definecharacter amacron 226
+\definecharacter cacute 227
+\definecharacter adiaeresis 228
+\definecharacter aring 229
+\definecharacter eogonek 230
+\definecharacter emacron 231
+\definecharacter ccaron 232
+\definecharacter eacute 233
+\definecharacter zacute 234
+\definecharacter edotaccent 235
+\definecharacter gcommaaccent 236
+\definecharacter kcommaaccent 237
+\definecharacter imacron 238
+\definecharacter lcommaaccent 239
+\definecharacter scaron 240
+\definecharacter nacute 241
+\definecharacter ncommaaccent 242
+\definecharacter oacute 243
+\definecharacter omacron 244
+\definecharacter otilde 245
+\definecharacter odiaeresis 246
+\definecharacter textdiv 247
+\definecharacter uogonek 248
+\definecharacter lstroke 249
+\definecharacter sacute 250
+\definecharacter umacron 251
+\definecharacter udiaeresis 252
+\definecharacter zdotaccent 253
+\definecharacter zcaron 254
+\definecharacter quoteright 255
+
+\stopencoding
+
+\endinput
diff --git a/tex/context/base/lpdf-ano.lua b/tex/context/base/lpdf-ano.lua
index 2ebb98bb6..017a3919a 100644
--- a/tex/context/base/lpdf-ano.lua
+++ b/tex/context/base/lpdf-ano.lua
@@ -350,6 +350,25 @@ function specials.page(var,actions) -- better resolve in strc-ref
end
end
+-- todo, do this in references namespace ordered instead (this is an experiment)
+
+local splitter = lpeg.splitat(":")
+
+function specials.order(var,actions) -- jobreferences.specials !
+ local operation = var.operation
+ if operation then
+ local kind, name, n = lpegmatch(splitter,operation)
+ local order = lists.ordered[kind]
+ order = order and order[name]
+ local v = order[tonumber(n)]
+ local r = v and v.references.realpage
+ if r then
+ var.operation = r -- brrr, but test anyway
+ return specials.page(var,actions)
+ end
+ end
+end
+
function specials.url(var,actions) -- better resolve in strc-ref
local url = var.operation
if url then
diff --git a/tex/context/base/node-fin.mkiv b/tex/context/base/node-fin.mkiv
index 9a5ce6f32..ea9e83f16 100644
--- a/tex/context/base/node-fin.mkiv
+++ b/tex/context/base/node-fin.mkiv
@@ -27,6 +27,8 @@
% tricky stuff:
+% THIS MIGHT BECOME OBSOLETE.
+
\newcount\attributeboxcount
\edef\startinheritattributes{\attribute\triggerattribute\plusone}
diff --git a/tex/context/base/ppchtex.mkii b/tex/context/base/ppchtex.mkii
index 285b0004e..045e9808b 100644
--- a/tex/context/base/ppchtex.mkii
+++ b/tex/context/base/ppchtex.mkii
@@ -1477,7 +1477,6 @@
\getvalue{\s!chemicallinesegment#22}%
\undochemicaloffset}
-
\def\getprivatechemicallinesegment[#1][#2]%
{\chemicalrotate[#1]%
\getvalue{\s!chemicallinesegment#2#1}}
@@ -1531,8 +1530,104 @@
\def\processchemicalunrotatedlinesegment#1%
{\doprocesschemicallinesegment3{#1}\getchemicallinesegment}
-\def\processchemicaldashedlinesegment%
+\def\processchemicaldashedlinesegment
{\doprocesschemicallinesegment4c\getchemicallinesegment}
+
+\def\plotchemicaldasheddeltaline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ z20 = z2 rotatedaround(z1,+5) ;
+ z21 = z2 rotatedaround(z1,-5) ;
+ draw (z1 rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ save n ; n := 5 ;
+ for i=1 upto n :
+ draw ((((z20--z21) shifted -z2) shifted (i/n)[z2,z1])
+ rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ endfor
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\plotchemicalwavyline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ save d ; pair d ;
+ d := z2 rotatedaround(z1,+5) shifted -z2 ;
+ save n ; n := 4 ;
+ draw ((for i=0 upto n-1 :
+ ((i)/n)[z1,z2] ..
+ ((i+.25)/n)[z1,z2] shifted d ..
+ ((i+.50)/n)[z1,z2] ..
+ ((i+.75)/n)[z1,z2] shifted -d ..
+ endfor
+ z2) rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\processchemicaldasheddeltalinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicaldasheddeltaline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
+
+\def\processchemicalwavylinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicalwavyline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
\def\processchemicalopenend#1#2%
{\doprocesschemicallinesegment0c\doprocesschemicalopenend{#1}{#2}}
@@ -2395,6 +2490,8 @@
DB##3##4##5=>\processchemicallinesegment{DB}{##3##4##5},
SB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5},
BB##3##4##5=>\processchemicaldeltalinesegment{SB}{##3##4##5},
+ BD##3##4##5=>\processchemicaldasheddeltalinesegment{SB}{##3##4##5},
+ BW##3##4##5=>\processchemicalwavylinesegment{SB}{##3##4##5},
SD##3##4##5=>\processchemicaldashedlinesegment{SB}{##3##4##5},
TB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5}%
\processchemicallinesegment{DB}{##3##4##5},
diff --git a/tex/context/base/ppchtex.mkiv b/tex/context/base/ppchtex.mkiv
index f0fc54bcc..8ea089627 100644
--- a/tex/context/base/ppchtex.mkiv
+++ b/tex/context/base/ppchtex.mkiv
@@ -1455,8 +1455,104 @@
\def\processchemicalunrotatedlinesegment#1%
{\doprocesschemicallinesegment3{#1}\getchemicallinesegment}
-\def\processchemicaldashedlinesegment%
+\def\processchemicaldashedlinesegment
{\doprocesschemicallinesegment4c\getchemicallinesegment}
+
+\def\plotchemicaldasheddeltaline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ z20 = z2 rotatedaround(z1,+5) ;
+ z21 = z2 rotatedaround(z1,-5) ;
+ draw (z1 rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ save n ; n := 5 ;
+ for i=1 upto n :
+ draw ((((z20--z21) shifted -z2) shifted (i/n)[z2,z1])
+ rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ endfor
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\plotchemicalwavyline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ save d ; pair d ;
+ d := z2 rotatedaround(z1,+5) shifted -z2 ;
+ save n ; n := 4 ;
+ draw ((for i=0 upto n-1 :
+ ((i)/n)[z1,z2] ..
+ ((i+.25)/n)[z1,z2] shifted d ..
+ ((i+.50)/n)[z1,z2] ..
+ ((i+.75)/n)[z1,z2] shifted -d ..
+ endfor
+ z2) rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\processchemicaldasheddeltalinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicaldasheddeltaline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
+
+\def\processchemicalwavylinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicalwavyline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
\def\processchemicalopenend#1#2%
{\doprocesschemicallinesegment0c\doprocesschemicalopenend{#1}{#2}}
@@ -2227,6 +2323,9 @@
% afstand dubbele radikalen : 260
% afstand substituenten : +125
+
+
+
\def\executechemicalONE[#1]%
{\setchemicalname ONE
%
@@ -2312,6 +2411,8 @@
DB##3##4##5=>\processchemicallinesegment{DB}{##3##4##5},
SB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5},
BB##3##4##5=>\processchemicaldeltalinesegment{SB}{##3##4##5},
+ BD##3##4##5=>\processchemicaldasheddeltalinesegment{SB}{##3##4##5},
+ BW##3##4##5=>\processchemicalwavylinesegment{SB}{##3##4##5},
SD##3##4##5=>\processchemicaldashedlinesegment{SB}{##3##4##5},
TB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5}%
\processchemicallinesegment{DB}{##3##4##5},
diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv
index b36106f11..f9d573707 100644
--- a/tex/context/base/strc-des.mkiv
+++ b/tex/context/base/strc-des.mkiv
@@ -629,14 +629,10 @@
\newtoks \everyenumeration
\newconditional\enumerationnumberenabled
-\chardef \enumerationcouplingmode \zerocount
\def \enumerationdisablenumbersignal {-}
\appendtoks \disablepseudocaps \to \everyenumeration % sorry, uppercase causes troubles
-\letvalue{\??dd:\c!couplingway:\v!local }\plusone
-\letvalue{\??dd:\c!couplingway:\v!global}\plustwo
-
\setvalue{\??dd:\v!enumeration:\s!handler:\s!number}{\@@doenumerationnumber}
\setvalue{\??dd:\v!enumeration:\s!handler:\s!text }{\@@doenumerationtext}
\setvalue{\??dd:\v!enumeration:\s!handler }{\@@doenumerationhandler}
@@ -697,32 +693,32 @@
\def\doenumerationrestorecounter {\restorestructurecounter[\currentdescriptionnumber]}
\def\doenumerationincrementcounter{\doincrementsubstructurecounter[\currentdescriptionnumber][\currentdescriptionlevel]}
+% to be used in for instance:
+%
+% coupling=questions .... coupling=answers
+%
+% we will provide some more control, like skipping etc or reference relates
+
\def\doenumerationcheckconditions
{\doifelse{\descriptionparameter\c!number}\v!yes
{\ifx\currentdescriptionreference\enumerationdisablenumbersignal
\setfalse\enumerationnumberenabled \else \settrue\enumerationnumberenabled
\fi}%
{\setfalse\enumerationnumberenabled}%
- \chardef\enumerationcouplingmode \iflocation
- \executeifdefined{\??dd:\c!couplingway:\descriptionparameter\c!coupling}\zerocount
- \else
- \zerocount
- \fi}
+ \edef\currentenumerationcoupling{\descriptionparameter\c!coupling}}
\def\doenumerationregistercoupling
{\iflocation
- \ifcase\enumerationcouplingmode
- \or
- % todo
- \or
- % todo
- \fi
+ % no area yet, we will provide variants some day
\fi}
\def\doenumerationcouplingsymbol
- {\iflocation\ifcase\enumerationcouplingmode \else
- % todo
- \fi\fi}
+ {\iflocation \ifx\currentenumerationcoupling\empty\else
+ \symbolreference[order(description:\currentenumerationcoupling:\nextinternalorderreference)]%
+ \fi \fi}
+
+\def\skipenumerationcoupling[#1]% e.g. for questions with no answer
+ {\ctxlua{jobreferences.setnextorder("description","#1")}}
\def\showdnpuretext{\strut\descriptionparameter\c!text} % geen spatie
\def\showdnlisttext{\descriptionparameter\c!listtext} % space in default
@@ -822,7 +818,8 @@
\glet\currentdescriptionsynchronize\relax
\glet\currentdescriptionattribute \relax
\else
- \setnextinternalreference
+ %\setnextinternalreference
+ \setnextinternalreferences{description}\currentdescriptionname % plural
\xdef\currentdescriptionnumberentry{\ctxlua{structure.lists.push{
metadata = {
kind = "description",
@@ -832,6 +829,7 @@
},
references = {
internal = \nextinternalreference,
+ order = \nextinternalorderreference,
reference = "\currentdescriptionreference",
referenceprefix = "\referenceprefix",
block = "\currentstructureblock",
diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua
index 2cf8d4947..5f6726d44 100644
--- a/tex/context/base/strc-lst.lua
+++ b/tex/context/base/strc-lst.lua
@@ -11,10 +11,11 @@ if not modules then modules = { } end modules ['strc-lst'] = {
-- section, metadata cache (internal then has to move up one level) or a
-- shared cache [we can use a fast and stupid serializer]
-local format, gmatch = string.format, string.gmatch
+local format, gmatch, gsub = string.format, string.gmatch, string.gsub
local tonumber = tonumber
local texsprint, texprint, texwrite, texcount = tex.sprint, tex.print, tex.write, tex.count
local concat, insert, remove = table.concat, table.insert, table.remove
+local lpegmatch = lpeg.match
local trace_lists = false trackers.register("structure.lists", function(v) trace_lists = v end)
@@ -136,18 +137,19 @@ function lists.popnesting()
lists.result = old.result
end
+-- will be split
+
local function filter_collected(names, criterium, number, collected, nested)
local numbers, depth = documents.data.numbers, documents.data.depth
local hash, result, all, detail = { }, { }, not names or names == "" or names == variables.all, nil
+ names, criterium = gsub(names," ",""), gsub(criterium," ","")
+ if trace_lists then
+ logs.report("lists","filtering names: %s, criterium: %s, number: %s",names,criterium,number or "-")
+ end
if not all then
- for s in gmatch(names,"[^, ]+") do
- if trace_lists then
- logs.report("lists","filtering: %s",s)
- end
+ for s in gmatch(names,"[^, ]+") do -- sort of settings to hash
hash[s] = true
end
- elseif trace_lists then
- logs.report("lists","filtering all")
end
if criterium == variables.intro then
-- special case, no structure yet
@@ -204,7 +206,7 @@ local function filter_collected(names, criterium, number, collected, nested)
end
end
elseif criterium == variables.here then
- -- this is qquite dirty ... as cnumbers is not sparse we can misuse #cnumbers
+ -- this is quite dirty ... as cnumbers is not sparse we can misuse #cnumbers
if depth == 0 then
return filter_collected(names,variables.intro,number,collected)
else
@@ -456,3 +458,25 @@ function lists.prefixednumber(name,n,prefixspec,numberspec)
end
end
end
+
+-- todo, do this in references namespace ordered instead (this is an experiment)
+--
+-- also see lpdf-ano (maybe move this there)
+
+local splitter = lpeg.splitat(":")
+
+function jobreferences.specials.order(var,actions) -- jobreferences.specials !
+ local operation = var.operation
+ if operation then
+ local kind, name, n = lpegmatch(splitter,operation)
+ local order = lists.ordered[kind]
+ order = order and order[name]
+ local v = order[tonumber(n)]
+ local r = v and v.references.realpage
+ if r then
+ actions.realpage = r
+ var.operation = r -- brrr, but test anyway
+ return jobreferences.specials.page(var,actions)
+ end
+ end
+end
diff --git a/tex/context/base/strc-lst.mkiv b/tex/context/base/strc-lst.mkiv
index 79a9f2e8f..b13ee5371 100644
--- a/tex/context/base/strc-lst.mkiv
+++ b/tex/context/base/strc-lst.mkiv
@@ -544,12 +544,13 @@
{[\currentlist: #3 -- #4 -- #5]}}
\def\domakelistelement#1#2#3#4% ref internal command data
- {\dontleavehmode
- \doifnot{\listparameter\c!interaction}{#1}\locationfalse
- \iflocation
- \directgotobox{\setlocationcolor\??ia#4}[internal(#2)]%
+ {\dontleavehmode
+ \iflocation % we cannot tewak \iflocation as we nest
+ \doifelse{\listparameter\c!interaction}{#1}
+ {\directgoto{\setlocationcolor\??ia#4}[internal(#2)]}% was \directgotobox
+ {#3{#4}}%
\else
- #3{#4}%
+ #3{#4}%
\fi}
\def\dodofreelistelement#1#2#3#4#5#6#7#8%
@@ -616,8 +617,8 @@
{\!!widtha\listparameter\c!width}}%
\getvalue{\??li\c!alternative\listparameter\c!alternative}%
\endgraf
- \doif{\listparameter\c!interaction}\v!text % not supported ! ! ! ! ! ! text == all
- {\setlistparameter\currentlist\c!interaction\v!all}%
+% \doif{\listparameter\c!interaction}\v!text % not supported ! ! ! ! ! ! text == all
+% {\setlistparameter\currentlist\c!interaction\v!all}%
% \dontleavehmode % new, else no margin, but wrong, better (else \indent as well):
\noindent
\domakelistelement\v!all{#2}\hbox
@@ -668,6 +669,7 @@
\leavevmode
\box2\relax
\hskip\dimen2
+\domakelistelement\v!text{#2}\firstofoneargument{%
\bgroup
\donestedlistattributes\c!textstyle\c!textcolor
{\let\\=\newlineinlist
@@ -676,6 +678,7 @@
\limitatedlistentry{#4}}%
%\carryoverpar % new otherwise wrong linespacing
\egroup
+}%
\ifdim\wd4=\zeropoint\relax % \ifvoid4
% \ifdim\!!widtha<\hsize \hfill\strut \fi % spoils align
\else
@@ -724,17 +727,20 @@
\ifvmode
\noindent\leavevmode % leavevmode ? ? ?
\fi
+%% actually, the next can be supported now (will be enabled when I have time to test it)
\doif{\listparameter\c!interaction}\v!text % not supported
{\setlistparameter\currentlist\c!interaction\v!sectionnumber}%
\doif{\listparameter\c!interaction}\v!all % not supported
{\setlistparameter\currentlist\c!interaction\v!sectionnumber}%
+%%
\setbox4\hbox
{\doif{\listparameter\c!pagenumber}\v!yes
{\doifsomething{#5}
{\domakelistelement\v!pagenumber{#2}\hbox
{\donestedlistattributes\c!pagestyle\c!pagecolor
{\listparameter\c!pagecommand{#5}}}}}}%
- \doif{\listparameter\c!headnumber}\v!yes
+%% \domakelistelement\v!all{#2}\firstofoneargument{%
+ \doif{\listparameter\c!headnumber}\v!yes
{\donetrue
\doifnothing{#3}{\doifnothing{\listparameter\c!symbol}\donefalse}%
% == \doifnothing{#3\listparameter\c!symbol}\donefalse
@@ -749,17 +755,20 @@
\nobreak
\fi}%
\tolerance3500 % niet zomaar veranderen
+%% \domakelistelement\v!text{#2}\firstofoneargument{%
\donestedlistattributes\c!textstyle\c!textcolor
{\let\\=\newlineinlist
\dontconvertfont
%\listparameter\c!textcommand{#4}}%
\limitatedlistentry{#4}}%
+%% }%
\ifvoid4\else
\nobreak
\hskip.75em\relax
\nobreak
\box4
\fi
+%% }%
\dimen0=\listparameter\c!distance\relax
\ifdim\dimen0<1em\relax
\hskip1em\!!plus1em\!!minus.25em\relax
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index b21b6e524..52bc2a51b 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['strc-ref'] = {
local format, find, gmatch, match, concat = string.format, string.find, string.gmatch, string.match, table.concat
local lpegmatch = lpeg.match
-local texsprint, texwrite, texcount = tex.sprint, tex.write, tex.count
+local texsprint, texwrite, texcount, texsetcount = tex.sprint, tex.write, tex.count, tex.setcount
local trace_referencing = false trackers.register("structure.referencing", function(v) trace_referencing = v end)
@@ -70,6 +70,33 @@ end
-- todo: delay split till later as in destinations we split anyway
+local orders, lastorder = { }, 0
+
+local function setnextorder(kind,name)
+ lastorder = 0
+ if kind and name then
+ local ok = orders[kind]
+ if not ok then
+ ok = { }
+ orders[kind] = ok
+ end
+ lastorder = (ok[name] or 0) + 1
+ ok[name] = lastorder
+ end
+ texsetcount("global","locationorder",lastorder)
+end
+
+jobreferences.setnextorder = setnextorder
+
+function jobreferences.setnextinternal(kind,name)
+ setnextorder(kind,name) -- always incremented with internal
+ texsetcount("global","locationcount",texcount.locationcount + 1)
+end
+
+function jobreferences.currentorder(kind,name)
+ texwrite((orders[kind] and orders[kind][name]) or lastorder)
+end
+
function jobreferences.set(kind,prefix,tag,data)
for ref in gmatch(tag,"[^,]+") do
local p, r = match(ref,"^(%-):(.-)$")
@@ -877,7 +904,7 @@ jobreferences.current_metadata = current_metadata
function jobreferences.get_current_prefixspec(default) -- todo: message
texsprint(ctxcatcodes,"\\getreferencestructureprefix{",
- current_metadata("kind"), "}{", current_metadata("name") or "?", "}{", default, "}")
+ current_metadata("kind") or "?", "}{", current_metadata("name") or "?", "}{", default or "?", "}")
end
--~ function jobreferences.get_current_prefixspec(default) -- we can consider storing the data at the lua end
@@ -1093,7 +1120,6 @@ function jobreferences.analyse(actions)
return actions
end
-
function jobreferences.realpage() -- special case, we always want result
local cs = jobreferences.analyse()
texwrite(cs.realpage or 0)
@@ -1146,7 +1172,7 @@ end
specials.i = specials.internal
-function specials.page(var,actions)
+function specials.page(var,actions) -- is this ok?
local p = pages[var.operation]
if type(p) == "function" then
p = p()
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index a50c7d714..d8fe470d1 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -514,16 +514,25 @@
%D \gotosomeinternal {tag}{identifier}{pagenumber}{text}
%D \stoptyping
+%D We could do this in lua ...
+
\newif \iflocation
\newcount\locationcount
+\newcount\locationorder
\newbox \locationbox
-\def\nextinternalreference
- {\the\locationcount}
+\def\nextinternalreference {\the\locationcount}
+\def\nextinternalorderreference{\the\locationorder}
\def\setnextinternalreference
{\global\advance\locationcount\plusone}
+\def\setnextinternalreferences#1#2% plural
+ {\ctxlua{jobreferences.setnextinternal("#1","#2")}}
+
+\def\getinternalorderreference#1#2%
+ {\ctxlua{jobreferences.currentorder("#1","#2")}}
+
\def\thisissomeinternal#1#2% tag reference (only for old time sake)
{\begingroup\attribute\destinationattribute\ctxlua{jobreferences.mark("#1:#2")}\hbox{}\endgroup}
@@ -811,18 +820,41 @@
\fi}[#1]}
{[?]}}
+\unexpanded\def\referencesymbol
+ {\hbox{\strut\high
+ {\setupsymbolset[\@@iasymbolset]%
+ \symbol
+ [\ifcase\referencepagestate
+ \v!somewhere
+ \or % same
+ \v!nowhere
+ \or % before
+ \v!previous
+ \or % after
+ \v!next%
+ \fi]}}}
+
+% \def\dosymbolreference#1#2[#3]%
+% {\removeunwantedspaces
+% \goto{\setupsymbolset[\@@iasymbolset]\high{\symbol
+% [\ifcase\referencepagestate
+% \v!somewhere
+% \or % same
+% \v!nowhere
+% \or % before
+% \v!previous
+% \or % after
+% \v!next%
+% \fi]}}[#3]}
+
\def\dosymbolreference#1#2[#3]%
{\removeunwantedspaces
- \goto{\setupsymbolset[\@@iasymbolset]\high{\symbol
- [\ifcase\referencepagestate
- \v!somewhere
- \or % same
- \v!nowhere
- \or % before
- \v!previous
- \or % after
- \v!next%
- \fi]}}[#3]}
+ \goto{\referencesymbol}[#3]}
+
+\def\symbolreference[#1]%
+ {\removeunwantedspaces
+ \goto{\referencesymbol}[#1]}
+
%D The other alternatives just conform their names: only the
%D label, only the text, or the label and the text.
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index bcbe715a1..8a7d3be48 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 01/22/10 19:15:02
+-- merge date : 01/25/10 11:14:13
do -- begin closure to overcome local limits and interference