diff options
-rw-r--r-- | metapost/context/base/mp-tool.mp | 46 | ||||
-rw-r--r-- | scripts/context/ruby/rlxtools.rb | 6 | ||||
-rw-r--r-- | tex/context/base/char-def.lua | 2 | ||||
-rw-r--r-- | tex/context/base/char-ini.lua | 12 | ||||
-rw-r--r-- | tex/context/base/cont-new.tex | 2 | ||||
-rw-r--r-- | tex/context/base/context.mkiv | 1 | ||||
-rw-r--r-- | tex/context/base/context.tex | 2 | ||||
-rw-r--r-- | tex/context/base/core-job.mkii | 10 | ||||
-rw-r--r-- | tex/context/base/core-job.mkiv | 9 | ||||
-rw-r--r-- | tex/context/base/meta-fun.lua | 55 | ||||
-rw-r--r-- | tex/context/base/meta-fun.mkiv | 20 | ||||
-rw-r--r-- | tex/context/base/page-app.tex | 5 | ||||
-rw-r--r-- | tex/context/base/s-abr-01.tex | 1 | ||||
-rw-r--r-- | tex/context/base/x-mathml.mkiv | 10 | ||||
-rw-r--r-- | tex/generic/context/luatex-fonts-merged.lua | 2 |
15 files changed, 141 insertions, 42 deletions
diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp index 8cc6d1f89..f80c867b9 100644 --- a/metapost/context/base/mp-tool.mp +++ b/metapost/context/base/mp-tool.mp @@ -822,10 +822,17 @@ enddef ; %D Handy for testing/debugging: primarydef p crossed d = - (center p shifted (-d, 0) -- llcorner p -- - center p shifted ( 0,-d) -- lrcorner p -- - center p shifted (+d, 0) -- urcorner p -- - center p shifted ( 0,+d) -- ulcorner p -- cycle) + if pair p : + (p shifted (-d, 0) -- p -- + p shifted ( 0,-d) -- p -- + p shifted (+d, 0) -- p -- + p shifted ( 0,+d) -- p -- cycle) + else : + (center p shifted (-d, 0) -- llcorner p -- + center p shifted ( 0,-d) -- lrcorner p -- + center p shifted (+d, 0) -- urcorner p -- + center p shifted ( 0,+d) -- ulcorner p -- cycle) + fi enddef ; %D Also handy (math ladders): @@ -1009,35 +1016,18 @@ enddef ; %D Rather fundamental. -% vardef rightpath expr p = -% save q, t, b ; path q ; pair t, b ; -% t := (ulcorner p -- urcorner p) intersection_point p ; -% b := (llcorner p -- lrcorner p) intersection_point p ; -% if xpart directionpoint t of p < 0 : p := reverse p ; fi ; -% q := p cutbefore b ; -% q := q if xpart point 0 of p > 0 : & p fi cutafter t ; -% q -% enddef ; -% -% vardef leftpath expr p = -% save q, t, b ; path q ; pair t, b ; -% t := (ulcorner p -- urcorner p) intersection_point p ; -% b := (llcorner p -- lrcorner p) intersection_point p ; -% if xpart directionpoint t of p < 0 : p := reverse p ; fi ; -% q := p cutbefore t ; -% q := q if xpart point 0 of p > 0 : & p fi cutafter b ; -% q -% enddef ; +% not yet ok def leftrightpath(expr p, l) = - save q, t, b ; path q ; pair t, b ; + save q, r, t, b ; path q, r ; pair t, b ; t := (ulcorner p -- urcorner p) intersection_point p ; b := (llcorner p -- lrcorner p) intersection_point p ; - if xpart directionpoint t of p < 0 : p := reverse p ; fi ; - q := p cutbefore if l: t else: b fi ; - q := q if xpart point 0 of p > 0 : & - p fi cutafter if l: b else: t fi ; + r := if xpart directionpoint t of p < 0 : reverse p else : p fi ; % r is needed, else problems when reverse is fed + q := r cutbefore if l: t else: b fi ; + q := q if xpart point 0 of r > 0 : & + r fi cutafter if l: b else: t fi ; q + x enddef ; vardef leftpath expr p = leftrightpath(p,true ) enddef ; diff --git a/scripts/context/ruby/rlxtools.rb b/scripts/context/ruby/rlxtools.rb index 36bc9f790..6a5c5ca20 100644 --- a/scripts/context/ruby/rlxtools.rb +++ b/scripts/context/ruby/rlxtools.rb @@ -112,7 +112,7 @@ class Commands REXML::XPath.each(localsteps,tag) do |extras| REXML::XPath.each(extras,"rl:value") do |value| if name = value.attributes['name'] then - substititute(value,variables[name.to_s] || '') + substitute(value,variables[name.to_s] || '') end end end @@ -145,7 +145,7 @@ class Commands end REXML::XPath.each(command,"rl:value") do |value| if name = value.attributes['name'] then - substititute(value,variables[name.to_s]) + substitute(value,variables[name.to_s]) end end str = justtext(command.to_s) @@ -204,7 +204,7 @@ class Commands return str.strip end - def substititute(value,str='') + def substitute(value,str='') if str then begin if value.attributes.key?('method') then diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua index 205c84bc0..2cc7eee39 100644 --- a/tex/context/base/char-def.lua +++ b/tex/context/base/char-def.lua @@ -523,7 +523,7 @@ characters.data={ linebreak="is", --~ mathclass="punctuation", mathclass="relation", - mathname="colon", +-- mathname="colon", unicodeslot=0x003A, }, { diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index 974366b7a..ff42d91ee 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -401,7 +401,8 @@ function characters.define(tobelettered, tobeactivated) -- catcodetables -- we can use a macro instead of direct settings local fallback = chr.fallback if fallback then - texprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\checkedchar{",u,"}{",fallback,"}}}") + -- texprint(format("{\\catcode %s=13\\unexpanded\\gdef %s{\\checkedchar{%s}{%s}}}",u,utfchar(u),u,fallback)) + texsprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\checkedchar{",u,"}{",fallback,"}}}") -- no texprint activated[#activated+1] = "\\c"..u.."\\a" else local contextname = chr.contextname @@ -411,15 +412,18 @@ function characters.define(tobelettered, tobeactivated) -- catcodetables -- by this time, we're still in normal catcode mode -- subtle: not "\\",contextname but "\\"..contextname if chr.unicodeslot < 128 then - texprint(ctxcatcodes, "\\chardef\\"..contextname,"=",u) + -- texprint(ctxcatcodes, "\\chardef\\"..contextname,"=",u) + texprint(ctxcatcodes,format("\\chardef\\%s=%s",contextname,u)) else - texprint(ctxcatcodes, "\\let\\"..contextname,"=",utfchar(u)) + -- texprint(ctxcatcodes, "\\let\\"..contextname,"=",utfchar(u)) + texprint(ctxcatcodes,format("\\let\\%s=%s",contextname,utfchar(u))) if is_letter[category] then lettered[#lettered+1] = "\\c"..u.."\\l" end end elseif is_command[category] then - texprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\"..contextname,"}}") + -- texprint(format("{\\catcode %s=13\\unexpanded\\gdef %s{\\%s}}",u,utfchar(u),contextname)) + texsprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\"..contextname,"}}") -- no texprint activated[#activated+1] = "\\c"..u.."\\a" end elseif is_letter[category] then diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 6525a9a0c..effac4b79 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{2009.06.04 22:20} +\newcontextversion{2009.06.07 13:11} %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.mkiv b/tex/context/base/context.mkiv index 14df1c300..7473b39b3 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -248,6 +248,7 @@ \loadmarkfile{meta-ini} \loadmarkfile{meta-tex} \loadmarkfile{meta-pdf} +\loadmarkfile{meta-fun} \loadcorefile{meta-pag.tex} diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 22bd4228b..2889cf196 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{2009.06.04 22:20} +\edef\contextversion{2009.06.07 13:11} %D For those who want to use this: diff --git a/tex/context/base/core-job.mkii b/tex/context/base/core-job.mkii index 59d8552df..a8a753e0d 100644 --- a/tex/context/base/core-job.mkii +++ b/tex/context/base/core-job.mkii @@ -203,6 +203,16 @@ \expandafter\finalend \fi} + +\let\autostoptext\relax + +\def\autostarttext + {\ifcase\textlevel + \starttext + \writestatus\m!systems{auto \string\starttext..\string\stoptext}% + \let\autostoptext\stoptext + \fi} + \def\finalend {\ifnum\textlevel>\zerocount \else \the\everybye diff --git a/tex/context/base/core-job.mkiv b/tex/context/base/core-job.mkiv index cdb1564f4..84877eb3f 100644 --- a/tex/context/base/core-job.mkiv +++ b/tex/context/base/core-job.mkiv @@ -146,6 +146,15 @@ \expandafter\finalend \fi} +\let\autostoptext\relax + +\def\autostarttext + {\ifcase\textlevel + \starttext + \writestatus\m!systems{auto \string\starttext..\string\stoptext}% + \let\autostoptext\stoptext + \fi} + \def\finalend {\ifnum\textlevel>\zerocount \else \the\everybye diff --git a/tex/context/base/meta-fun.lua b/tex/context/base/meta-fun.lua new file mode 100644 index 000000000..84d4afb19 --- /dev/null +++ b/tex/context/base/meta-fun.lua @@ -0,0 +1,55 @@ +if not modules then modules = { } end modules ['meta-fun'] = { + version = 1.001, + comment = "companion to meta-fun.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +-- very experimental, actually a joke ... see metafun manual for usage + +local format, loadstring, type = string.format, loadstring, type +local texwrite = tex.write + +metafun = metafun or { } + +function metafun.topath(t,connector) + tex.write("(") + if #t > 0 then + for i=1,#t do + if i > 1 then + texwrite(connector or "..") + end + local ti = t[i] + if type(ti) == "string" then + texwrite(ti) + else + texwrite(format("(%s,%s)",ti.x or ti[1] or 0,ti.y or ti[2] or 0)) + end + end + else + texwrite("origin") + end + texwrite(")") +end + +function metafun.interpolate(f,b,e,s,c) + local done = false + tex.write("(") + for i=b,e,(e-b)/s do + local d = loadstring(format("return function(x) return %s end",f)) + if d then + d = d() + if done then + texwrite(c or "...") + else + done = true + end + texwrite(format("(%s,%s)",i,d(i))) + end + end + if not done then + texwrite("origin") + end + texwrite(")") +end diff --git a/tex/context/base/meta-fun.mkiv b/tex/context/base/meta-fun.mkiv new file mode 100644 index 000000000..a43ffefff --- /dev/null +++ b/tex/context/base/meta-fun.mkiv @@ -0,0 +1,20 @@ +%D \module +%D [ file=meta-fun, +%D version=2009.06.02, +%D title=\METAPOST\ Graphics, +%D subtitle=Goodies, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{MetaPost Graphics / Goodies} + +\registerctxluafile{meta-fun}{1.001} + +\unprotect + +\protect \endinput diff --git a/tex/context/base/page-app.tex b/tex/context/base/page-app.tex index 005ea6dd4..e5c149aa0 100644 --- a/tex/context/base/page-app.tex +++ b/tex/context/base/page-app.tex @@ -35,8 +35,10 @@ \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint, \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + \def\dostartfittingpage[#1][#2]% {\page % this is kind of tricky! there can be preceding page refs + \autostarttext \bgroup % resulting in a zero height page; test fig-make ! \def\currentfittingpage{#1}% \dontcomplain @@ -87,7 +89,8 @@ \centerbox{\box\scratchbox}% \stopmakeup \stoplocallayout - \egroup} + \egroup + \autostoptext} %D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}): diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex index 5f15ecbe6..45bca44f2 100644 --- a/tex/context/base/s-abr-01.tex +++ b/tex/context/base/s-abr-01.tex @@ -204,6 +204,7 @@ \logo [SGML] {sgml} \logo [SI] {si} \logo [SQL] {sql} +\logo [SVG] {svg} \logo [TABLE] {\TaBlE} \logo [TCPIP] {tcp/ip} \logo [TDS] {tds} % no sc te diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv index 6630a4901..649798c9f 100644 --- a/tex/context/base/x-mathml.mkiv +++ b/tex/context/base/x-mathml.mkiv @@ -1552,11 +1552,17 @@ } { \mathopnolimits{log}_{\xmlfirst{#1}{/mml:logbase}} } +% \MMLcreset + \xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)} +% \xmlsetup{#1}{mml:function} % todo, we start elsewhere +% \mmlthird{#1} } { \mathopnolimits{log} +% \MMLcreset +% \xmlsetup{#1}{mml:function} % todo, we start elsewhere + \xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)} +% \mmlsecond{#1} } - \MMLcreset - \xmlsetup{#1}{mml:function} \stopxmlsetups \startxmlsetups mml:ln diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index bc21e8ed3..08b079f9e 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 : 06/04/09 22:22:55 +-- merge date : 06/07/09 13:14:18 do -- begin closure to overcome local limits and interference |