From 2a63a54a60c937176ac6d667670e0911f0010dac Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 16 Oct 2014 12:15:04 +0200 Subject: 2014-10-16 11:55:00 --- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4386 -> 4384 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/status-files.pdf | Bin 24702 -> 24726 bytes tex/context/base/status-lua.pdf | Bin 333867 -> 333868 bytes tex/context/base/typo-del.mkiv | 54 ++++++++++++++++++--- tex/context/base/typo-mar.lua | 2 +- tex/context/base/x-asciimath.lua | 53 ++++++++++---------- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 9 files changed, 77 insertions(+), 38 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 164daaa29..c5f6df4c4 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.10.15 18:22} +\newcontextversion{2014.10.16 11:53} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index b9f12117e..e58cbbe87 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index e8730c1bd..260027119 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.10.15 18:22} +\edef\contextversion{2014.10.16 11:53} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 54c07a7e4..c2d1abd1c 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 9374361ec..9bd3da7b3 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/typo-del.mkiv b/tex/context/base/typo-del.mkiv index fadb93810..1018d3563 100644 --- a/tex/context/base/typo-del.mkiv +++ b/tex/context/base/typo-del.mkiv @@ -501,7 +501,7 @@ \fi} \def\typo_delimited_left_symbol#1% - {\setbox\scratchbox\hbox{#1}% + {\setbox\scratchbox\hbox{\usedelimitedtextstyleandcolor\c!symstyle\c!symcolor#1}% \dontleavehmode \edef\p_delimited_margin{\delimitedtextparameter\c!location}% \ifx\p_delimited_margin\v!margin @@ -510,7 +510,7 @@ \box\scratchbox} \def\typo_delimited_right_symbol#1% - {\hsmash{#1}} + {\hsmash{\usedelimitedtextstyleandcolor\c!symstyle\c!symcolor#1}} \def\typo_delimited_nextleft_symbol#1% {\localleftbox\bgroup @@ -541,6 +541,7 @@ \def\typo_delimited_handle_middle#1% {\begingroup + \usedelimitedtextstyleandcolor\c!symstyle\c!symcolor \setbox\scratchbox\hbox{\delimitedtextparameter#1}% \ifdim\wd\scratchbox>\zeropoint \ifdim\lastkern=\d_typo_delimited_signal @@ -560,6 +561,7 @@ \def\typo_delimited_handle_left#1% {\begingroup + \usedelimitedtextstyleandcolor\c!symstyle\c!symcolor \setbox\scratchbox\hbox{\delimitedtextparameter#1}% \ifdim\wd\scratchbox>\zeropoint \ifdim\lastkern=\d_typo_delimited_signal @@ -583,6 +585,7 @@ \def\typo_delimited_handle_right#1% {\begingroup + \usedelimitedtextstyleandcolor\c!symstyle\c!symcolor \setbox\scratchbox\hbox{\delimitedtextparameter#1}% \ifdim\wd\scratchbox>\zeropoint \ifdim\lastkern=\d_typo_delimited_signal @@ -613,14 +616,50 @@ \dostoptagged \typo_delimited_pop}} +% \unexpanded\def\typo_delimited_txt +% {\doifelse{\delimitedtextparameter\c!style}\v!normal +% \typo_delimited_quoted +% \typo_delimited_attributed} +% +% \def\typo_delimited_quoted_b +% {\dostarttagged\t!delimited\currentdelimitedtext +% \typo_delimited_handle_left\c!left} +% +% \def\typo_delimited_quoted_e +% {\typo_delimited_handle_right\c!right +% \removelastskip +% \dostoptagged +% \typo_delimited_pop} +% +% \def\typo_delimited_attributed_b +% {\dostarttagged\t!delimited\currentdelimitedtext +% \usedelimitedtextstyleandcolor\c!style\c!color} +% +% \def\typo_delimited_attributed_e +% {\dostoptagged +% \typo_delimited_pop} +% +% \def\typo_delimited_fontdriven_b +% {\dostarttagged\t!delimited\currentdelimitedtext +% \languageparameter{\c!left\currentparentdelimitedtext}}% was: \currentdelimitedtext +% +% \def\typo_delimited_fontdriven_e +% {\languageparameter{\c!right\currentparentdelimitedtext}% was: \currentdelimitedtext +% \dostoptagged +% \typo_delimited_pop} + \unexpanded\def\typo_delimited_txt - {\doifelse{\delimitedtextparameter\c!style}\v!normal - \typo_delimited_quoted - \typo_delimited_attributed} + {\edef\p_left_right{\delimitedtextparameter\c!left\delimitedtextparameter\c!right}% + \ifx\p_left_right\empty + \expandafter\typo_delimited_attributed + \else + \expandafter\typo_delimited_quoted + \fi} \def\typo_delimited_quoted_b {\dostarttagged\t!delimited\currentdelimitedtext - \typo_delimited_handle_left\c!left} + \typo_delimited_handle_left\c!left + \usedelimitedtextstyleandcolor\c!style\c!color} \def\typo_delimited_quoted_e {\typo_delimited_handle_right\c!right @@ -638,7 +677,8 @@ \def\typo_delimited_fontdriven_b {\dostarttagged\t!delimited\currentdelimitedtext - \languageparameter{\c!left\currentparentdelimitedtext}}% was: \currentdelimitedtext + \languageparameter{\c!left\currentparentdelimitedtext}% was: \currentdelimitedtext + \usedelimitedtextstyleandcolor\c!style\c!color} \def\typo_delimited_fontdriven_e {\languageparameter{\c!right\currentparentdelimitedtext}% was: \currentdelimitedtext diff --git a/tex/context/base/typo-mar.lua b/tex/context/base/typo-mar.lua index 8ec499ee4..22b899a68 100644 --- a/tex/context/base/typo-mar.lua +++ b/tex/context/base/typo-mar.lua @@ -622,7 +622,7 @@ local function inject(parent,head,candidate) if trace_margindata then report_margindata("top aligned by %p",delta) end - if delta < candidate.threshold then + if delta < candidate.threshold then -- often we need a negative threshold here shift = shift + voffset + delta end elseif method == v_first then diff --git a/tex/context/base/x-asciimath.lua b/tex/context/base/x-asciimath.lua index c172077a8..b4177ddd3 100644 --- a/tex/context/base/x-asciimath.lua +++ b/tex/context/base/x-asciimath.lua @@ -100,7 +100,6 @@ local reserved = { ["gcd"] = { false, "\\gcd" }, ["min"] = { false, "\\min" }, ["max"] = { false, "\\max" }, - ["in"] = { false, "\\in" }, ["ln"] = { false, "\\ln" }, ["atan"] = { false, "\\atan" }, -- extra @@ -749,6 +748,7 @@ for k, v in sortedhash(reserved) do if v[1] then k_unicode[k] = replacement else + k_unicode[k] = k -- keep them ... later we remap these if k ~= replacement then k_reserved_different[#k_reserved_different+1] = k end @@ -891,9 +891,10 @@ local function show_state(t,level,state) report_asciimath(serialize(t,f_state(level,state))) end -local function show_result(str,result) - report_asciimath("input > %s",str) - report_asciimath("result > %s",result) +local function show_result(original,unicoded,texcoded) + report_asciimath("original > %s",original) + report_asciimath("unicoded > %s",unicoded) + report_asciimath("texcoded > %s",texcoded) end local function collapse_matrices(t) @@ -1326,20 +1327,13 @@ local function collapse_fractions_1(t) if current == "/" and i > 1 then local tl = t[i-1] local tr = t[i+1] - -- if type(tl) == "table" then - -- if isleft[tl[1]] and isright[tl[#tl]] then - -- tl[1] = "" - -- tl[#tl] = "" - -- end - -- end - -- if type(tr) == "table" then - -- if isleft[tr[1]] and isright[tr[#tr]] then - -- tr[1] = "" - -- tr[#tr] = "" - -- end - -- end t[m] = "\\frac{" .. tl .. "}{" .. tr .. "}" i = i + 2 + if i < n then + m = m + 1 + t[m] = t[i] + i = i + 1 + end else m = m + 1 t[m] = current @@ -1365,6 +1359,11 @@ local function collapse_fractions_2(t) if current == "⁄" and i > 1 then -- \slash t[m] = "{" .. s_left .. t[i-1] .. s_mslash .. t[i+1] .. s_right .. "}" i = i + 2 + if i < n then + m = m + 1 + t[m] = t[i] + i = i + 1 + end else m = m + 1 t[m] = current @@ -1434,7 +1433,7 @@ local function convert(str,totex) local unicoded = lpegmatch(u_parser,str) local texcoded = collapse(lpegmatch(a_parser,unicoded)) if trace_mapping then - show_result(str,texcoded) + show_result(str,unicoded,texcoded) end if totex then ctx_mathematics(texcoded) @@ -1499,15 +1498,15 @@ local function register(s,cleanedup,collected,shortname) end f.dirty[s] = (f.dirty[s] or 0) + 1 else - local texcode = convert(s) - local message = invalidtex(texcode) + local texcoded = convert(s) + local message = invalidtex(texcoded) if message then report_asciimath("%s: %s",message,s) end collected[c] = { count = 1, files = { [shortname] = 1 }, - texcode = texcode, + texcoded = texcoded, message = message, cleanedup = s ~= c and 1 or 0, dirty = { [s] = 1 } @@ -1586,20 +1585,20 @@ local function convert(str) if #str == 1 then ctx_mathematics(str) else - local unicode = lpegmatch(u_parser,str) - local texcode = collapse(lpegmatch(a_parser,unicode)) + local unicoded = lpegmatch(u_parser,str) + local texcoded = collapse(lpegmatch(a_parser,unicoded)) if trace_mapping then - show_result(str,texcode) + show_result(str,unicoded,texcoded) end - if #texcode == 0 then + if #texcoded == 0 then report_asciimath("error in asciimath: %s",str) else - local message = invalidtex(texcode) + local message = invalidtex(texcoded) if message then report_asciimath("%s: %s",message,str) ctx_type(formatters["<%s>"](message)) else - ctx_mathematics(texcode) + ctx_mathematics(texcoded) end end end @@ -1765,7 +1764,7 @@ function show.result(n) elseif v.message then ctx_color(color, v.message) else - ctx_mathematics(v.texcode) + ctx_mathematics(v.texcoded) end end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 93261ccc2..1fcdabf1c 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 10/15/14 18:22:36 +-- merge date : 10/16/14 11:53:40 do -- begin closure to overcome local limits and interference -- cgit v1.2.3