From 8601b3c9b34e6ff21d413b5b9256d76d867c2aec Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 8 Sep 2017 00:30:40 +0200 Subject: 2017-09-07 23:55:00 --- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-de.mkii | 2 + tex/context/base/mkiv/back-exp.lua | 196 ++++++++++++++++----- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-ctx.lua | 9 + tex/context/base/mkiv/font-unk.mkiv | 29 +-- tex/context/base/mkiv/luat-run.lua | 1 + tex/context/base/mkiv/math-ali.mkiv | 71 +++----- tex/context/base/mkiv/math-tag.lua | 19 +- tex/context/base/mkiv/node-syn.lua | 10 +- tex/context/base/mkiv/status-files.pdf | Bin 25844 -> 25840 bytes tex/context/base/mkiv/status-lua.pdf | Bin 426471 -> 426575 bytes tex/context/base/mkiv/strc-sec.mkiv | 8 +- tex/context/base/mkiv/strc-tag.mkiv | 2 + tex/context/interface/mkii/keys-de.xml | 2 + tex/context/interface/mkiv/i-context.pdf | Bin 818663 -> 818532 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 60775 -> 60775 bytes tex/context/modules/mkiv/m-scite.mkiv | 12 +- tex/context/modules/mkiv/s-present-lines.mkiv | 160 +++++++++++++++++ tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 22 files changed, 407 insertions(+), 124 deletions(-) create mode 100644 tex/context/modules/mkiv/s-present-lines.mkiv (limited to 'tex') diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 24441710a..9fa8fbf00 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.09.05 15:10} +\newcontextversion{2017.09.07 23:44} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index f93bb1e35..a6b52218e 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2017.09.05 15:10} +\edef\contextversion{2017.09.07 23:44} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index f11749025..de622fc76 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -753,6 +753,7 @@ \setinterfaceconstant{direction}{richtung} \setinterfaceconstant{directory}{verzeichnis} \setinterfaceconstant{display}{bildschirm} +\setinterfaceconstant{displaythreshold}{displaythreshold} \setinterfaceconstant{distance}{abstand} \setinterfaceconstant{domain}{domain} \setinterfaceconstant{dot}{punkt} @@ -862,6 +863,7 @@ \setinterfaceconstant{index}{index} \setinterfaceconstant{indicator}{indikator} \setinterfaceconstant{initialsep}{initialsep} +\setinterfaceconstant{inlinethreshold}{inlinethreshold} \setinterfaceconstant{inner}{innen} \setinterfaceconstant{innermargin}{innermargin} \setinterfaceconstant{inputfile}{inputfile} diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua index 98e28eca1..3ad9418ec 100644 --- a/tex/context/base/mkiv/back-exp.lua +++ b/tex/context/base/mkiv/back-exp.lua @@ -1238,24 +1238,23 @@ do } end if ndata == 0 then +root.skip = "comment" -- get rid of weird artefacts +root.nota = "weird" return elseif ndata == 1 then local d = data[1] - if not d or d == "" or d.content then + if not d or d == "" then +root.skip = "comment" + return + elseif d.content then return else -- if ndata == 1 then local tg = d.tg - if automathrows and roottg == "mrow" then +-- if automathrows and roottg == "mrow" then +if automathrows and (roottg == "mrow" or roottg == "mtext") then -- maybe just always ! check spec first +-- or we can have chesks.* for each as we then can flatten if no_mrow[tg] then --- local r = root.__p__ --- while r do --- if r.data[1].tg == "mrow" then --- r.data[1].skip = "comment" --- r.skip = "comment" --- end --- break --- end root.skip = "comment" end elseif roottg == "mo" then @@ -1588,55 +1587,157 @@ do return di end end - -- could be integrated but is messy then --- while roottg == "mrow" and #data == 1 do --- data = data[1] --- for k, v in next, data do --- root[k] = v --- end --- roottg = data.tg --- end end end function checks.math(di) - local specification = specifications[di.fulltag] - local mode = specification and specification.mode == "display" and "block" or "inline" - di.attributes = { - ["display"] = mode, - ["xmlns:m"] = mathmlns, - } - -- can be option if needed: - if mode == "inline" then - -- di.nature = "mixed" -- else spacing problem (maybe inline) - di.nature = "inline" -- we need to catch x$X$x and x $X$ x + if di.skip == "comment" then + -- already done, kind of weird, happens in mathmatrix, maybe some collapse + -- issue that i need to look into else - di.nature = "display" + local specification = specifications[di.fulltag] + local mode = specification and specification.mode == "display" and "block" or "inline" + di.attributes = { + ["display"] = mode, + ["xmlns:m"] = mathmlns, + } + -- can be option if needed: + if mode == "inline" then + -- di.nature = "mixed" -- else spacing problem (maybe inline) + di.nature = "inline" -- we need to catch x$X$x and x $X$ x + else + di.nature = "display" + end + if automathstrip then + stripmath(di) + end + checkmath(di) end - if automathstrip then - stripmath(di) + end + + -- this one can replace some of the previous code .. todo (test on mathmatrix) + + -- ignore with no data can be removed + + local function checked(d) + local n = #d + if n == 1 then + local di = d[1] + local tg = di.tg + if tg == "ignore" then + -- todo: we can move ignore's data one level up + return 1 + elseif di.content then + return 1 + else + local dd = di.data + if #dd > 0 and checked(dd) > 0 then + return 1 + else + return 0 + end + end + else + local m = 0 + for i=1,n do + local di = d[i] + local tg = di.tg + if tg == "ignore" then + -- skip + elseif di.content then + m = m + 1 + d[m] = di + else + local dd = di.data + if #dd > 0 and checked(dd) > 0 then + m = m + 1 + d[m] = di + end + end + end + if m < n then + for i=n,m+1,-1 do + d[i] = nil + end + end + return m end - checkmath(di) end - local a, z, A, Z = 0x61, 0x7A, 0x41, 0x5A + function checks.mrow(di) +-- local d = di.data +-- if d then +-- checked(d) +-- end + end + + -- we can move more checks here + + local function flatten(di) + local r = di.__p__ + while r do + local d = r.data + local n = #d + if d and n > 1 then + n = checked(d) + end + local tg = r.tg + if n == 1 and (tg == "mtext" or tg == "mrow") then + r.skip = "comment" -- weird error + r = r.__p__ + else + break + end + end + end - function extras.mi(di,element,n,fulltag) -- check with content - local str = di.data[1].content - if str and sub(str,1,1) ~= "&" then -- hack but good enough (maybe gsub op eerste) - for v in utfvalues(str) do - if (v >= a and v <= z) or (v >= A and v <= Z) then - local a = di.attributes - if a then - a.mathvariant = "normal" + function checks.mtable(di) + flatten(di) + local d = di.data + for i=1,#d do + local d = d[i] + if d.tg == "mtr" then + local d = d.data + for i=1,#d do + local d = d[i] + if d.tg == "mtd" then + -- okay + elseif d.content then + d.content = "" else - di.attributes = { mathvariant = "normal" } + d.skip = "comment" -- weird error end end + elseif d.content then + d.content = "" + else + d.skip = "comment" -- weird error end end end + do + + local a, z, A, Z = 0x61, 0x7A, 0x41, 0x5A + + function extras.mi(di,element,n,fulltag) -- check with content + local str = di.data[1].content + if str and sub(str,1,1) ~= "&" then -- hack but good enough (maybe gsub op eerste) + for v in utfvalues(str) do + if (v >= a and v <= z) or (v >= A and v <= Z) then + local a = di.attributes + if a then + a.mathvariant = "normal" + else + di.attributes = { mathvariant = "normal" } + end + end + end + end + end + + end + function extras.msub(di,element,n,fulltag) -- m$^2$ local data = di.data @@ -2380,7 +2481,7 @@ do if check then check(d) end - checktree(d) + checktree(d) -- so parts can pass twice end end end @@ -3577,6 +3678,15 @@ local htmltemplate = [[ local xmltree = cleanxhtmltree(xml.convert(result)) +-- local xmltree = xml.convert(result) +-- for c in xml.collected(xmltree,"m:mtext[lastindex()=1]/m:mrow") do +-- print(c) +-- end +-- for c in xml.collected(xmltree,"mtext/mrow") do +-- print(c) +-- end +-- local xmltree = cleanxhtmltree(xmltree) + xml.save(xmltree,xhtmlfilename) -- now we save a specification file that can b eused for generating an epub file diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index cb106828b..eb134e077 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.09.05 15:10} +\newcontextversion{2017.09.07 23:44} %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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index ac617fc5b..62ffab044 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -41,7 +41,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.09.05 15:10} +\edef\contextversion{2017.09.07 23:44} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index 53683c491..8e57e568b 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -1673,6 +1673,15 @@ do -- else too many locals return infofont end + -- abstract interfacing + + implement { name = "tf", actions = function() setmacro("fontalternative","tf") end } + implement { name = "bf", actions = function() setmacro("fontalternative","bf") end } + implement { name = "it", actions = function() setmacro("fontalternative","it") end } + implement { name = "sl", actions = function() setmacro("fontalternative","sl") end } + implement { name = "bi", actions = function() setmacro("fontalternative","bi") end } + implement { name = "bs", actions = function() setmacro("fontalternative","bs") end } + end local enable_auto_r_scale = false diff --git a/tex/context/base/mkiv/font-unk.mkiv b/tex/context/base/mkiv/font-unk.mkiv index 988e5df3d..4b2615c20 100644 --- a/tex/context/base/mkiv/font-unk.mkiv +++ b/tex/context/base/mkiv/font-unk.mkiv @@ -52,17 +52,19 @@ \definefontsynonym [Handwriting] [unknown] \definefontsynonym [Calligraphic] [unknown] -%D This permit us to define (use) fonts that refer to the default -%D style (so, Bold may expand to SansBold or SerifBold, depending -%D on the default style in the typeface). - -\definefontsynonym[\s!Normal] [\noexpand\v_font_string_d] -\definefontsynonym[\s!Bold] [\noexpand\v_font_string_d\noexpand\s!Bold] -\definefontsynonym[\s!Italic] [\noexpand\v_font_string_d\noexpand\s!Italic] -\definefontsynonym[\s!Slanted] [\noexpand\v_font_string_d\noexpand\s!Slanted] -\definefontsynonym[\s!BoldItalic] [\noexpand\v_font_string_d\noexpand\s!BoldItalic] -\definefontsynonym[\s!BoldSlanted][\noexpand\v_font_string_d\noexpand\s!BoldSlanted] -\definefontsynonym[\s!Caps] [\noexpand\v_font_string_d\noexpand\s!Caps] +%D This permit us to define (use) fonts that refer to the default style (so, Bold +%D may expand to SansBold or SerifBold, depending on the default style in the +%D typeface). The \LUA\ call is used to set the current alternative in a +%D non|-|interfering way. This make sure that the CurrentFont synonym (in font-sym) +%D is working as expected (e.g.\ in MixedCaps). Yes, this is complicates stuff. + +\definefontsynonym[\s!Normal] [\noexpand\clf_tf\noexpand\v_font_string_d] +\definefontsynonym[\s!Bold] [\noexpand\clf_bf\noexpand\v_font_string_d\noexpand\s!Bold] +\definefontsynonym[\s!Italic] [\noexpand\clf_it\noexpand\v_font_string_d\noexpand\s!Italic] +\definefontsynonym[\s!Slanted] [\noexpand\clf_sl\noexpand\v_font_string_d\noexpand\s!Slanted] +\definefontsynonym[\s!BoldItalic] [\noexpand\clf_bi\noexpand\v_font_string_d\noexpand\s!BoldItalic] +\definefontsynonym[\s!BoldSlanted][\noexpand\clf_bs\noexpand\v_font_string_d\noexpand\s!BoldSlanted] +\definefontsynonym[\s!Caps] [\noexpand\clf_tf\noexpand\v_font_string_d\noexpand\s!Caps] %D Also handy: @@ -143,8 +145,7 @@ \definebodyfont [default] [cg] [\s!tf=Calligraphy sa 1] -%D These definitions come into action as soon as names are -%D mapped onto real file names (or names that themselves are -%D mapped). +%D These definitions come into action as soon as names are mapped onto real file +%D names (or names that themselves are mapped). \protect \endinput diff --git a/tex/context/base/mkiv/luat-run.lua b/tex/context/base/mkiv/luat-run.lua index b194e755e..14927dbbc 100644 --- a/tex/context/base/mkiv/luat-run.lua +++ b/tex/context/base/mkiv/luat-run.lua @@ -207,6 +207,7 @@ local function report_stop(right) -- report_close("%i > %i > %s",level,total,name or "?") report_close("level %i, order %i, name %a",level,total,name or "?") level = level - 1 + synctex.setfilename(stack[#stack] or tex.jobname) end end end diff --git a/tex/context/base/mkiv/math-ali.mkiv b/tex/context/base/mkiv/math-ali.mkiv index 81ec511e6..c82170463 100644 --- a/tex/context/base/mkiv/math-ali.mkiv +++ b/tex/context/base/mkiv/math-ali.mkiv @@ -891,8 +891,7 @@ \let\endmath\relax \def\MC{\NC}% % - \mathmatrixleft - \mathmatrixbox \bgroup + \setbox\nextbox\vbox\bgroup \math_matrix_start_table \halign \bgroup % preamble @@ -907,6 +906,8 @@ \egroup \math_matrix_stop_table \egroup + \mathmatrixleft + \math_matrix_finish_nextbox \mathmatrixright \egroup} @@ -951,7 +952,6 @@ \setupcurrentmathmatrix[#1]% \fi \math_matrix_check_settings - \math_matrix_align_method_analyze \math_matrix_set_defaults \math_matrix_set_columns \math_matrix_start_processing} @@ -961,51 +961,34 @@ \endgroup \popmacro\NC} -\installcorenamespace{mathmatrixalignmethod} +% vcenter: +% +% delta = (height(v) + depth(v))/2 +% axis = math_axis_size(cur_size) +% height(v) = delta + axis +% depth(v) = delta - axis + +\installcorenamespace{mathmatrixalignlocation} \let\mathmatrixleft \empty % experimental hook \let\mathmatrixright\empty % experimental hook -\def\math_matrix_process#1#2% - {\dowithnextbox - {\scratchdimen\dimexpr(\nextboxdp-\nextboxht)/2 \ifcase#2\or+\mathaxisheight\textfont2\fi\relax - \ifcase#1\relax\or\lower\scratchdimen\or\or\raise\scratchdimen\fi\hbox\bgroup - \forgettagging % otherwise dummy mrows and such - \normalstartimath - \mathmatrixparameter\c!left - \vcenter{\unvbox\nextbox}% - \mathmatrixparameter\c!right - \normalstopimath - \egroup}% - \vbox} - -\unexpanded\def\installmathmatrixalignmethod#1#2% - {\setvalue{\??mathmatrixalignmethod#1}{#2}} - -\def\math_matrix_box_normal{\math_matrix_process\plustwo\zerocount} - -\let\mathmatrixbox\math_matrix_box_normal - -% \def\math_matrix_align_method_analyze -% {\csname\??mathmatrixalignmethod\ifcsname\??mathmatrixalignmethod\mathmatrixparameter\c!location\endcsname -% \mathmatrixparameter\c!location -% \else -% \v!normal -% \fi\endcsname} - -\def\math_matrix_align_method_analyze - {\ifcsname\??mathmatrixalignmethod\mathmatrixparameter\c!location\endcsname - \lastnamedcs - \else - \let\mathmatrixbox\math_matrix_box_normal - \fi} - -\installmathmatrixalignmethod\v!top {\def\mathmatrixbox{\math_matrix_process\plusthree\plusone }} -\installmathmatrixalignmethod\v!high {\def\mathmatrixbox{\math_matrix_process\plusthree\zerocount}} -\installmathmatrixalignmethod\v!lohi {\def\mathmatrixbox{\math_matrix_process\plustwo \zerocount}} -\installmathmatrixalignmethod\v!low {\def\mathmatrixbox{\math_matrix_process\plusone \zerocount}} -\installmathmatrixalignmethod\v!bottom{\def\mathmatrixbox{\math_matrix_process\plusone \plusone }} -\installmathmatrixalignmethod\v!normal{\let\mathmatrixbox \math_matrix_box_normal} % lohi +\setvalue{\??mathmatrixalignlocation\v!top }{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\textfont\zerocount\relax} +\setvalue{\??mathmatrixalignlocation\v!high }{\raise\dimexpr(\nextboxdp-\nextboxht)/2\relax} +\setvalue{\??mathmatrixalignlocation\v!center}{\relax} +\setvalue{\??mathmatrixalignlocation\v!lohi} {\relax} +\setvalue{\??mathmatrixalignlocation\v!normal}{\relax} +\setvalue{\??mathmatrixalignlocation\v!bottom}{\lower\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\textfont\zerocount\relax} +\setvalue{\??mathmatrixalignlocation\v!low }{\lower\dimexpr(\nextboxdp-\nextboxht)/2\relax} + +\def\math_matrix_finish_nextbox + {\begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup + \normalstartimath + \mathmatrixparameter\c!left + \vcenter{\box\nextbox}% + \mathmatrixparameter\c!right + \normalstopimath + \egroup} \definemathmatrix[matrix] \definemathmatrix[\v!mathmatrix] diff --git a/tex/context/base/mkiv/math-tag.lua b/tex/context/base/mkiv/math-tag.lua index 3b717af15..d1ed90d38 100644 --- a/tex/context/base/mkiv/math-tag.lua +++ b/tex/context/base/mkiv/math-tag.lua @@ -64,6 +64,7 @@ local math_fixed_both = accentcodes.fixedboth local kerncodes = nodes.kerncodes local fontkern_code = kerncodes.fontkern +local italickern_code = kerncodes.italickern local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist @@ -88,7 +89,7 @@ local taglist = tags.taglist local chardata = characters.data -local getmathcode = tex.getmathcode +local getmathcodes = tex.getmathcodes local mathcodes = mathematics.codes local ordinary_code = mathcodes.ordinary local variable_code = mathcodes.variable @@ -193,7 +194,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer mtexttag = start_tagged("mtext") end setattr(start,a_tagged,mtexttag) - elseif mtexttag and id == kern_code and getsubtype(start) == fontkern_code then + elseif mtexttag and id == kern_code and (getsubtype(start) == fontkern_code or getsubtype(start) == italickern_code) then -- italickern setattr(start,a_tagged,mtexttag) else if mtexttag then @@ -202,10 +203,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer end if id == math_char_code then local char = getchar(start) - local code = getmathcode(char) - if code then - code = code[1] - end + local code = getmathcodes(char) local tag if code == ordinary_code or code == variable_code then local ch = chardata[char] @@ -250,6 +248,9 @@ process = function(start) -- we cannot use the processor as we have no finalizer elseif id == math_box_code or id == hlist_code or id == vlist_code then -- keep an eye on math_box_code and see what ends up in there local attr = getattr(start,a_tagged) +if not attr then + -- just skip +else local specification = taglist[attr] if specification then local tag = specification.tagname @@ -321,7 +322,8 @@ process = function(start) -- we cannot use the processor as we have no finalizer if id == hlist_code or id == vlist_code then runner(getlist(n),depth+1) elseif id == glyph_code then - runner(getcomponents(n),depth+1) -- this should not be needed + -- this should not be needed (todo: use tounicode info) + runner(getcomponents(n),depth+1) elseif id == disc_code then local pre, post, replace = getdisc(n) runner(pre,depth+1) -- idem @@ -341,6 +343,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer stop_tagged() end end +end elseif id == math_sub_code then -- normally a hbox local list = getlist(start) if list then @@ -425,7 +428,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer -- left local properties = { } insert(fencesstack,properties) - setattr(start,a_tagged,start_tagged("mfenced",{ properties = properties })) -- needs checking + setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking if delim then start_tagged("ignore") local chr = getfield(delim,"small_char") diff --git a/tex/context/base/mkiv/node-syn.lua b/tex/context/base/mkiv/node-syn.lua index ee4387f00..d6730bb4d 100644 --- a/tex/context/base/mkiv/node-syn.lua +++ b/tex/context/base/mkiv/node-syn.lua @@ -246,24 +246,20 @@ function synctex.blockfilename(name) end function synctex.setfilename(name,line) -if paused == 0 then - if force_synctex_tag and name then + if paused == 0 and force_synctex_tag and name then force_synctex_tag(sttags[name]) if line then force_synctex_line(line) end end end -end function synctex.resetfilename() -if paused == 0 then - if force_synctex_tag then + if paused == 0 and force_synctex_tag then force_synctex_tag(0) force_synctex_line(0) end end -end -- the node stuff @@ -706,6 +702,8 @@ function synctex.finish() end end +local filename = nil + function synctex.pause() paused = paused + 1 if paused == 1 and enabled then diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index 60c16486a..22fbd7c09 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 334bdaa7b..82507f21e 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/strc-sec.mkiv b/tex/context/base/mkiv/strc-sec.mkiv index e976c2373..ef7e9108a 100644 --- a/tex/context/base/mkiv/strc-sec.mkiv +++ b/tex/context/base/mkiv/strc-sec.mkiv @@ -471,9 +471,11 @@ % compatible but better \appendtoks - \doifelse{\headparameter\c!ownnumber}\v!yes - {\setuevalue\currenthead{\strc_sectioning_handle_own[\currenthead]}} - {\setuevalue\currenthead{\strc_sectioning_handle_nop[\currenthead]}}% + \ifx\currenthead\empty \else + \doifelse{\headparameter\c!ownnumber}\v!yes + {\setuevalue\currenthead{\strc_sectioning_handle_own[\currenthead]}} + {\setuevalue\currenthead{\strc_sectioning_handle_nop[\currenthead]}}% + \fi \to \everysetuphead \unexpanded\def\doredefinehead#1#2% called at lua end diff --git a/tex/context/base/mkiv/strc-tag.mkiv b/tex/context/base/mkiv/strc-tag.mkiv index b25cd6108..9a234d6c8 100644 --- a/tex/context/base/mkiv/strc-tag.mkiv +++ b/tex/context/base/mkiv/strc-tag.mkiv @@ -539,4 +539,6 @@ \unexpanded\def\bpar{\dostarttagged\t!paragraph\empty\strc_tagged_saved_bpar} \unexpanded\def\epar{\strc_tagged_saved_epar\dostoptagged} +% \def\untagged{attr \taggedattribute\attributeunsetvalue} + \protect diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index aaf0594b2..99e04428d 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -759,6 +759,7 @@ + @@ -868,6 +869,7 @@ + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 6112ce18e..ccd8e2fed 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index b08267ccf..113894526 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv index 254402ddf..fb880f493 100644 --- a/tex/context/modules/mkiv/m-scite.mkiv +++ b/tex/context/modules/mkiv/m-scite.mkiv @@ -219,7 +219,8 @@ local function lexdata(data,lexname) data = data .. "\r" end if lexname == v_none then - data = string.formatters["%!tex!"](data) +-- data = string.formatters["%!tex!"](data) + data = exportstyled(loadedlexers["dummy"] or loadedlexers.tex,data) else data = exportstyled(loadedlexers[lexname] or loadedlexers.tex,data) end @@ -342,6 +343,10 @@ visualizers.register("txt", visualizer) \let\slxS\buff_scite_slxs \let\slxF\buff_scite_slxf +\def\module_scite_inherit_typing + {\buff_verbatim_initialize_typing_one + \buff_verbatim_set_line_margin} + \unexpanded\def\startscite {\begingroup \dosingleempty\buff_scite_start} @@ -363,6 +368,7 @@ visualizers.register("txt", visualizer) \clf_scitelexfile{#1}% \tt \installscitecommandsdisplay + \module_scite_inherit_typing \dontcomplain \raggedright \startcontextcode @@ -385,6 +391,7 @@ visualizers.register("txt", visualizer) \fi \tt \installscitecommandsdisplay + \module_scite_inherit_typing \dontcomplain \raggedright \startlines @@ -406,6 +413,7 @@ visualizers.register("txt", visualizer) \fi \tt \installscitecommandsinline + \module_scite_inherit_typing \dontcomplain \getbuffer[lex]% \endgroup} @@ -430,6 +438,8 @@ visualizers.register("txt", visualizer) \tt \installscitecommandsdisplay \dontcomplain +\buff_verbatim_initialize_typing_one +\buff_verbatim_set_line_margin \raggedright \startlines \clf_getbuffer{lex}} diff --git a/tex/context/modules/mkiv/s-present-lines.mkiv b/tex/context/modules/mkiv/s-present-lines.mkiv new file mode 100644 index 000000000..c3f1f75dc --- /dev/null +++ b/tex/context/modules/mkiv/s-present-lines.mkiv @@ -0,0 +1,160 @@ +%D \module +%D [ file=s-present-lines, +%D version=1017.09.01, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment Balls, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%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 This style was made for the \CONTEXT\ 2017 meeting. According to Alan Braslau we +%D should not display items that we discuss but for now I stick to it. As a +%D compromise this is a simple and effective style. + +\startmodule[present-lines] + +\definecolor[backcolor][s=.6] +\definecolor[pagecolor][s=.3] +\definecolor[dotscolor][s=.2] +\definecolor[maincolor][b=.6] + +\definecolor[maincolor][r=.6] + +\setuppapersize + [S6] + +\setuplayout + [header=0pt, + footer=0pt, + topspace=20mm, + backspace=20mm, + width=middle, + height=middle] + +\setupbackgrounds + [page] + [background=page] + +\defineoverlay + [page] + [\useMPgraphic{page}] + +\setupitemgroup +% [color=dotscolor] + [color=maincolor] + +\definesymbol + [1][{\symbol[\char"25A0]}] + +\setupbodyfont + [dejavu] + +\startuseMPgraphic{page} + StartPage ; + numeric d ; d := 15pt ; + fill Page + enlarged 2d + withcolor "pagecolor" ; + fill Field[Text][Text] + enlarged 2d + withcolor "backcolor" ; + draw leftboundary Field[Text][Text] + bottomenlarged 3d + topenlarged -(d/10) + shifted (-d,0) + withpen pensquare scaled (d/5) + withcolor "maincolor" ; + draw bottomboundary Field[Text][Text] + leftenlarged 3d + rightenlarged -(d/10) + shifted (0,-d) + withpen pensquare scaled (d/5) + withcolor "maincolor" ; + draw rightboundary Field[Text][Text] + topenlarged 3d + bottomenlarged -(d/10) + shifted (d,0) + withpen pensquare scaled (d/5) + withcolor "maincolor" ; + draw topboundary Field[Text][Text] + rightenlarged 3d + leftenlarged -(d/10) + shifted (0,d) + withpen pensquare scaled (d/5) + withcolor "maincolor" ; + StopPage ; +\stopuseMPgraphic + +\setuphead + [chapter,title] + [placehead=empty, + number=no, + after={\blank[disable]}, + before=] + +\setuptext + [color=pagecolor, + style=\bfd] + +\setuptexttexts + [\directsetup{text:texts}] + +\startsetups text:texts + \vbox to \textheight { + \vfill + \hfill + \setstrut + \strut + \getmarking[chapter] + \getmarking[title] + \vskip-\strutdp + } +\stopsetups + +\startsetups document:start + \startstandardmakeup + \startparagraph + % Per 01-02-2017 the Bold abstraction also makes sure that CurrentFont + % works well which in turn makes MixedCaps and such working. + \definedfont[Bold*default @ 42pt] + \setupinterlinespace + \startcolor[pagecolor] + \begstrut + \documentvariable{title} + \endstrut + \stopcolor + \stopparagraph + \blank[2*line] + \determinelistcharacteristics[chapter] + \ifnum\listlength>10\relax + \startcolumns + \placelist[chapter][alternative=f] + \stopcolumns + \else + \placelist[chapter][alternative=f] + \fi + \vfill + \hfill + \bfb + \setstrut + \strut + \startcolor[pagecolor] + \documentvariable{subtitle} + \stopcolor + \vskip-\strutdp + \stopstandardmakeup +\stopsetups + +\usemodule[abr-04] + +\stopmodule + +\continueifinputfile{s-present-lines.mkiv} + +% \usemodule[present-common] + +% \inputpresentationfile{examples/....} % todo, 2017 presentations diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 3eda9d031..43f54fef2 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 09/05/17 15:10:09 +-- merge date : 09/07/17 23:44:19 do -- begin closure to overcome local limits and interference -- cgit v1.2.3