From 66f36353ebae5235cc3bfe5f75b375e175857748 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 1 May 2015 19:15:04 +0200 Subject: 2015-05-01 18:47:00 --- tex/context/base/back-exp.lua | 134 ++++++++++++--------- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4189 -> 4183 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/export-example.css | 2 +- tex/context/base/font-pre.mkiv | 26 ++++ tex/context/base/font-tra.mkiv | 1 + tex/context/base/m-punk.mkiv | 30 +++-- tex/context/base/publ-ini.lua | 74 ++++++++---- tex/context/base/publ-ini.mkiv | 8 +- tex/context/base/spac-ali.mkiv | 18 ++- tex/context/base/status-files.pdf | Bin 24402 -> 24454 bytes tex/context/base/status-lua.pdf | Bin 250705 -> 250703 bytes tex/context/base/strc-lst.mkvi | 24 ++-- tex/context/base/strc-syn.mkiv | 3 +- tex/context/base/x-math-svg.lua | 11 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 17 files changed, 231 insertions(+), 106 deletions(-) (limited to 'tex') diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua index 4b3f83a3d..9e127cb09 100644 --- a/tex/context/base/back-exp.lua +++ b/tex/context/base/back-exp.lua @@ -68,10 +68,6 @@ local attributes = attributes local variables = interfaces.variables local v_yes = variables.yes local v_no = variables.no -local v_normal = variables.normal -local v_flushright = variables.flushright -local v_middle = variables.middle -local v_flushleft = variables.flushleft local implement = interfaces.implement @@ -153,6 +149,11 @@ local overloads = fonts.mappings.overloads local exportversion = "0.34" local mathmlns = "http://www.w3.org/1998/Math/MathML" local contextns = "http://www.contextgarden.net/context/export" -- whatever suits +local cssnamespaceurl = "@namespace context url('%namespace%') ;" +local cssnamespace = "context|" +----- cssnamespacenop = "/* no namespace */" + +local usecssnamespace = false local nofcurrentcontent = 0 -- so we don't free (less garbage collection) local currentcontent = { } @@ -201,13 +202,11 @@ local p_attribute = lpeg.replacer(attribentities) local p_stripper = lpeg.patterns.stripper local p_escaped = lpeg.patterns.xml.escaped -local f_id = formatters["%s-%s"] - -local alignmapping = { - flushright = "right", - middle = "center", - flushleft = "left", -} +-- local alignmapping = { +-- flushright = "right", +-- middle = "center", +-- flushleft = "left", +-- } local defaultnature = "mixed" -- "inline" @@ -329,7 +328,7 @@ local usedstyles = { } local namespacetemplate = [[ /* %what% for file %filename% */ -@namespace context url('%namespace%') ; +%cssnamespaceurl% ]] do @@ -340,9 +339,10 @@ do -- /* padding : ; */ -- /* text-justify : inter-word ; */ + -- /* text-align : justify ; */ local documenttemplate = [[ -document { +document, %namespace%div.document { font-size : %size% !important ; max-width : %width% !important ; text-width : %align% !important ; @@ -351,7 +351,7 @@ document { ]] local styletemplate = [[ -%element%[detail="%detail%"], context|div.%element%.%detail% { +%element%[detail="%detail%"], %namespace%div.%element%.%detail% { display : inline ; font-style : %style% ; font-variant : %variant% ; @@ -361,17 +361,19 @@ local styletemplate = [[ }]] local numbertoallign = { - [0] = "justify", ["0"] = "justify", [v_normal ] = "justify", - [1] = "right", ["1"] = "right", [v_flushright] = "right", - [2] = "center", ["2"] = "center", [v_middle ] = "center", - [3] = "left", ["3"] = "left", [v_flushleft ] = "left", + [0] = "justify", ["0"] = "justify", [variables.normal ] = "justify", + [1] = "right", ["1"] = "right", [variables.flushright] = "right", + [2] = "center", ["2"] = "center", [variables.middle ] = "center", + [3] = "left", ["3"] = "left", [variables.flushleft ] = "left", } function wrapups.allusedstyles(basename) local result = { replacetemplate(namespacetemplate, { - what = "styles", - filename = basename, - namespace = contextns, + what = "styles", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or cssnamespacenop, + cssnamespaceurl = cssnamespaceurl, }) } -- local bodyfont = finetuning.bodyfont @@ -398,7 +400,7 @@ local styletemplate = [[ align = numbertoallign[align] end if not align then - align = hyphens and "justify" or "inherited" + align = hyphen and "justify" or "inherited" end -- result[#result+1] = replacetemplate(documenttemplate,{ @@ -416,13 +418,14 @@ local styletemplate = [[ local c = colorspecification(data.color) detail = gsub(detail,"[^A-Za-z0-9]+","-") result[#result+1] = replacetemplate(styletemplate,{ - element = element, - detail = detail, - style = s.style or "inherit", - variant = s.variant or "inherit", - weight = s.weight or "inherit", - family = s.family or "inherit", - color = c or "inherit", + namespace = usecssnamespace and cssnamespace or "", + element = element, + detail = detail, + style = s.style or "inherit", + variant = s.variant or "inherit", + weight = s.weight or "inherit", + family = s.family or "inherit", + color = c or "inherit", }) end end @@ -436,7 +439,7 @@ local usedimages = { } do local imagetemplate = [[ -%element%[id="%id%"], context|div.%element%[id="%id%"] { +%element%[id="%id%"], %namespace%div.%element%[id="%id%"] { display : block ; background-image : url('%url%') ; background-size : 100%% auto ; @@ -469,23 +472,26 @@ local imagetemplate = [[ function wrapups.allusedimages(basename) local result = { replacetemplate(namespacetemplate, { - what = "images", - filename = basename, - namespace = contextns, + what = "images", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "", + cssnamespaceurl = cssnamespaceurl, }) } for element, details in sortedhash(usedimages) do for detail, data in sortedhash(details) do local name = data.name local page = tonumber(data.page) or 1 local spec = { - element = element, - id = data.id, - name = name, - page = page, - url = usedname(name,page), - width = data.width, - height = data.height, - used = data.used, + element = element, + id = data.id, + name = name, + page = page, + url = usedname(name,page), + width = data.width, + height = data.height, + used = data.used, + namespace = usecssnamespace and cssnamespace or "", } result[#result+1] = replacetemplate(imagetemplate,spec) collected[detail] = spec @@ -765,6 +771,8 @@ do local image = { } usedimages.image = image + local f_id = formatters["%s-%s"] + function structurestags.setfigure(name,used,page,width,height) local fulltag = locatedtag("image") local spec = specifications[fulltag] @@ -2885,14 +2893,14 @@ local cssheadlink = [[ local elementtemplate = [[ /* element="%element%" detail="%detail%" chain="%chain%" */ -%element%, context|div.%element% { +%element%, %namespace%div.%element% { display: %display% ; }]] local detailtemplate = [[ /* element="%element%" detail="%detail%" chain="%chain%" */ -%element%[detail=%detail%], context|div.%element%.%detail% { +%element%[detail=%detail%], %namespace%div.%element%.%detail% { display: %display% ; }]] @@ -2932,9 +2940,11 @@ local htmltemplate = [[ local function allusedelements(basename) local result = { replacetemplate(namespacetemplate, { - what = "template", - filename = basename, - namespace = contextns, + what = "template", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "", + cssnamespaceurl = cssnamespaceurl, }) } for element, details in sortedhash(used) do if namespaces[element] then @@ -2946,16 +2956,18 @@ local htmltemplate = [[ local display = displaymapping[nature] or "block" if detail == "" then result[#result+1] = replacetemplate(elementtemplate, { - element = element, - display = display, - chain = chain, + element = element, + display = display, + chain = chain, + namespace = usecssnamespace and namespace or "", }) else result[#result+1] = replacetemplate(detailtemplate, { - element = element, - display = display, - detail = detail, - chain = chain, + element = element, + display = display, + detail = detail, + chain = chain, + namespace = usecssnamespace and cssnamespace or "", }) end end @@ -3307,7 +3319,13 @@ local htmltemplate = [[ local examplefilename = resolvers.find_file("export-example.css") if examplefilename then - file.copy(examplefilename,defaultfilename) + local data = io.loaddata(examplefilename) + if not data or data == "" then + data = "/* missing css file */" + elseif not usecssnamespace then + data = gsub(data,cssnamespace,"") + end + io.savedata(defaultfilename,data) end if cssfile then @@ -3411,11 +3429,17 @@ local htmltemplate = [[ remap(specification,xmltree) + local title = specification.title + + if not title or title == "" then + title = "no title" -- believe it or not, but a can prevent viewing in browsers + end + local variables = { style = h_styles, body = xml.tostring(xml.first(xmltree,"/div")), preamble = wholepreamble(false), - title = specification.title, + title = title, } io.savedata(htmlfilename,replacetemplate(htmltemplate,variables,"xml")) diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7e42d8606..b7cfa2512 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{2015.04.29 19:31} +\newcontextversion{2015.05.01 18:45} %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 b9c48e16c..41901556d 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 977dfb769..8528545c0 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.04.29 19:31} +\edef\contextversion{2015.05.01 18:45} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/export-example.css b/tex/context/base/export-example.css index af99d95db..f44755892 100644 --- a/tex/context/base/export-example.css +++ b/tex/context/base/export-example.css @@ -774,7 +774,7 @@ context|div.math-display { /* number : inline */ quantity, context|div.quantity { - display : inline ; + display : inline-block ; } quantity>unit, context|div.quantity>context|div.unit { diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv index e003faa27..0bf0f6f79 100644 --- a/tex/context/base/font-pre.mkiv +++ b/tex/context/base/font-pre.mkiv @@ -193,6 +193,32 @@ tjmo=yes, vjmo=yes] +% cjk + +% \definefontfeature +% [japanese] +% [default] +% [language=jan] + +% \definefontfeature +% [simplified-chinese] +% [default] +% [language=zhs] + +% \definefontfeature +% [traditional-chinese] +% [default] +% [language=zht] + +% \definefontfeature +% [chinese] +% [simplified-chinese] + +% \definefontfeature +% [korean] +% [default] +% [language=kor] + % symbols: \definefontfeature diff --git a/tex/context/base/font-tra.mkiv b/tex/context/base/font-tra.mkiv index b0c3ae55b..3d6811a64 100644 --- a/tex/context/base/font-tra.mkiv +++ b/tex/context/base/font-tra.mkiv @@ -280,6 +280,7 @@ % \setupcolors[\c!state=\v!start]% \setupalign[\v!verytolerant,\v!flushleft]% \startotfsample + \nohyphens \global\setbox\otfcompositionbox\hbox{\definedfont[#1]\relax\getvalue{\??otfcompositiondir#2}\relax#3}% \stopotfsample \endgroup} diff --git a/tex/context/base/m-punk.mkiv b/tex/context/base/m-punk.mkiv index 6bf92e4c0..c8021a92f 100644 --- a/tex/context/base/m-punk.mkiv +++ b/tex/context/base/m-punk.mkiv @@ -162,6 +162,7 @@ function fonts.handlers.vf.combiner.commands.metafont(g,v) end g.properties.virtualized = true g.variants = list + print(g) end fonts.definers.methods.install( "punk", { @@ -177,14 +178,29 @@ fonts.definers.methods.install( "punkboldslanted", { { "metafont", "mfplain", "punkfont-boldslanted.mp", 10 }, } ) -typesetters.cases.register("RandomPunk", function(current) - local used = fontdata[current.font].variants +-- typesetters.cases.register("RandomPunk", function(current) +-- local used = fontdata[current].variants +-- if used then +-- local f = math.random(1,#used) +-- current.font = used[f] +-- return current, true +-- else +-- return current, false +-- end +-- end) + +local getfont = nodes.nuts.getfont +local setfield = nodes.nuts.setfield +local random = math.random + +typesetters.cases.register("RandomPunk", function(start) + local used = fontdata[getfont(start)].variants if used then - local f = math.random(1,#used) - current.font = used[f] - return current, true + local f = random(1,#used) + setfield(start,"font",used[f]) + return start, true else - return current, false + return start, false end end) @@ -214,7 +230,7 @@ end) \unexpanded\def\StartRandomPunk {\begingroup\EnableRandomPunk} \unexpanded\def\StopRandomPunk {\endgroup} -\starttypescript [serif] [punk] [default] +\starttypescript [serif] [punk] \definefontsynonym [Serif] [demo@punk] \definefontsynonym [SerifBold] [demobold@punkbold] \definefontsynonym [SerifSlanted] [demoslanted@punkslanted] diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 556f519f7..6afaf4335 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -2315,23 +2315,23 @@ do for i=1,#source do local entry = source[i] local current = entry.sortkey -- so we need a sortkey ! -if entry.suffix then - if not first then - first, last, firstr, lastr = current, current, entry, entry - else - flushrange() - first, last, firstr, lastr = current, current, entry, entry - end -else - if not first then - first, last, firstr, lastr = current, current, entry, entry - elseif current == last + 1 then - last, lastr = current, entry + if entry.suffix then + if not first then + first, last, firstr, lastr = current, current, entry, entry + else + flushrange() + first, last, firstr, lastr = current, current, entry, entry + end else - flushrange() - first, last, firstr, lastr = current, current, entry, entry + if not first then + first, last, firstr, lastr = current, current, entry, entry + elseif current == last + 1 then + last, lastr = current, entry + else + flushrange() + first, last, firstr, lastr = current, current, entry, entry + end end -end tags[#tags+1] = entry.tag end if first and last then @@ -2801,12 +2801,40 @@ end do + -- is this good enough? + + local keysorter = function(a,b) + local ak = a.authorhash + local bk = b.authorhash + if ak == bk then + local as = a.authorsuffix -- numeric + local bs = b.authorsuffix -- numeric + if as and bs then + return (as or 0) < (bs or 0) + else + return false + end + else + return ak < bk + end + end + + local revsorter = function(a,b) + return keysorter(b,a) + end + local currentbtxciteauthor = function() context.currentbtxciteauthor() return true -- needed? end local function authorcompressor(found,specification) + -- HERE + if specification.sorttype == v_normal then + sort(found,keysorter) + elseif specification.sorttype == v_reverse then + sort(found,revsorter) + end local result = { } local entries = { } for i=1,#found do @@ -2944,7 +2972,8 @@ end local function setter(data,dataset,tag,entry) data.author, data.field, data.type = getcasted(dataset,tag,"author") -data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return + data.sortkey = text and lpegmatch(numberonly,text) + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return end local function getter(first,last,_,specification) @@ -2958,10 +2987,11 @@ data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted retu function citevariants.author(presets) processcite(presets,{ - variant = "author", - setup = "author", - setter = setter, - getter = getter, + variant = "author", + setup = "author", + setter = setter, + getter = getter, + compressor = authorcompressor, }) end @@ -2971,7 +3001,7 @@ data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted retu local entries = entry.entries local text = entries and entries.text or "?" data.author, data.field, data.type = getcasted(dataset,tag,"author") -data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return data.num = text data.sortkey = text and lpegmatch(numberonly,text) end @@ -2996,7 +3026,7 @@ data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted retu local function setter(data,dataset,tag,entry) data.author, data.field, data.type = getcasted(dataset,tag,"author") -data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return local year = getfield (dataset,tag,"year") local suffix = getdetail(dataset,tag,"authorsuffix") data.year = year diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index f913ff3bd..120116e0a 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -952,8 +952,8 @@ [\c!type=\s!btx]% \c!location=\v!none [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% - \ifx\currentbtxbefore\empty\else\s!btxbtx=\!!bs\currentbtxbefore\!!es,\fi% - \ifx\currentbtxafter \empty\else\s!btxatx=\!!bs\currentbtxafter \!!es,\fi% + \ifx\currentbtxbefore\empty\else\s!btxbtx={\currentbtxbefore},\fi% + \ifx\currentbtxafter \empty\else\s!btxatx={\currentbtxafter },\fi% \s!btxint=\number\currentbtxbacklink \ifx\currentbtxciteuservariables\empty\else,\currentbtxciteuservariables\fi]} @@ -1243,13 +1243,15 @@ \relax \clf_btxflushmarked} % maybe: \iftrialtypesetting\else ... \fi +\let\dobtxcitevariantblob\publ_cite_handle_variant_blob % command can use it via lua + \def\publ_cite_handle_variant_indeed[#1]% {\letbtxparameter\c!alternative\currentbtxcitealternative \edef\currentbtxreference{#1}% \usebtxstyleandcolor\c!style\c!color \uselanguageparameter\btxdatasetparameter % new \btxparameter\c!left - \btxparameter\c!command{\publ_cite_handle_variant_blob}% + \btxparameter\c!command{\dobtxcitevariantblob}% {\publ_cite_handle_variant_blob}% \btxparameter\c!right \endgroup} diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv index fbcce89c4..6686bce53 100644 --- a/tex/context/base/spac-ali.mkiv +++ b/tex/context/base/spac-ali.mkiv @@ -1066,12 +1066,26 @@ \letvalue{\??alignsimplereverse\v!middle }\spac_align_simple_middle \unexpanded\def\simplealignedbox#1#2% - {\hbox to #1\csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\endcsname} + {\hbox \ifdim#1>\zeropoint to #1 + \csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\expandafter\endcsname + \fi} + +\unexpanded\def\simplealignedboxplus#1#2#3% + {\hbox #3 \ifdim#1>\zeropoint to #1 + \csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\expandafter\endcsname + \fi} \newconditional\alignsimplelefttoright \settrue\alignsimplelefttoright \unexpanded\def\simplereversealignedbox#1#2% - {\hbox to #1\csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\endcsname} + {\hbox \ifdim#1>\zeropoint to #1 + \csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\expandafter\endcsname + \fi} + +\unexpanded\def\simplereversealignedboxplus#1#2#3% + {\hbox #3 \ifdim#1>\zeropoint to #1 + \csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\expandafter\endcsname + \fi} % \installnamespace{alignsets} % diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 8a968413d..19e711540 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 91de40e87..937a176a9 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/strc-lst.mkvi b/tex/context/base/strc-lst.mkvi index 556d2ab48..803e6b813 100644 --- a/tex/context/base/strc-lst.mkvi +++ b/tex/context/base/strc-lst.mkvi @@ -953,11 +953,19 @@ \scratchhsize\hsize \ifconditional\c_lists_has_number \ifconditional\c_lists_show_number - \setbox\b_strc_lists_number\hbox \strc_lists_get_reference_attribute\v!number \ifdim\scratchwidth>\zeropoint to \scratchwidth \fi { - \strc_lists_set_style_color\c!numberstyle\c!numbercolor\v!number - \listparameter\c!numbercommand\currentlistsymbol - \hfill - } + \setbox\b_strc_lists_number +% \hbox +% \strc_lists_get_reference_attribute\v!number +% \ifdim\scratchwidth>\zeropoint to \scratchwidth \fi + \simplealignedboxplus + \scratchwidth + {\listparameter\c!numberalign} + {\strc_lists_get_reference_attribute\v!number} + { + \strc_lists_set_style_color\c!numberstyle\c!numbercolor\v!number + \listparameter\c!numbercommand\currentlistsymbol +% \hfill + } \else \setbox\b_strc_lists_number\emptyhbox \fi @@ -1268,11 +1276,7 @@ \ifconditional\c_lists_has_number \ifconditional\c_lists_show_number \setbox\scratchbox - \ifzeropt\scratchwidth - \hbox - \else - \simplealignedbox\scratchwidth{\listparameter\c!numberalign} - \fi + \simplealignedbox\scratchwidth{\listparameter\c!numberalign} \bgroup \useliststyleandcolor\c!numberstyle\c!numbercolor \currentlistsymbol diff --git a/tex/context/base/strc-syn.mkiv b/tex/context/base/strc-syn.mkiv index 0c132a602..b206f8069 100644 --- a/tex/context/base/strc-syn.mkiv +++ b/tex/context/base/strc-syn.mkiv @@ -332,7 +332,8 @@ \unexpanded\def\strc_synonyms_insert_meaning#1#2% name tag {\begingroup \def\currentsimplelist{#1}% - \fastsetup{\??simplelistrenderings:\v!text}% + \def\currentsynonymtag{#2}% + \fastsetup{\??simplelistrenderings::\v!text}% \endgroup} \unexpanded\def\strc_synonyms_insert#1#2% name tag diff --git a/tex/context/base/x-math-svg.lua b/tex/context/base/x-math-svg.lua index 263827f92..8a6288167 100644 --- a/tex/context/base/x-math-svg.lua +++ b/tex/context/base/x-math-svg.lua @@ -40,8 +40,10 @@ local pdftosvg = os.which("mudraw") local f_make_tex = formatters[ [[context --global kpse:x-math-svg.mkvi --inputfile="%s" --svgstyle="%s" --batch --noconsole --once --purgeall]] ] local f_make_svg = formatters[ [[mudraw -o "math-%%d.svg" "%s" 1-9999]] ] -local f_inline = formatters[ [[<div class='math-inline' style='vertical-align:%p'></div>]] ] +----- f_inline = formatters[ [[<div class='math-inline' style='vertical-align:%p'></div>]] ] +local f_inline = formatters[ [[<div class='math-inline'></div>]] ] local f_display = formatters[ [[<div class='math-display'></div>]] ] +local f_style = formatters[ [[vertical-align:%p]] ] local f_math_tmp = formatters[ [[math-%i]] ] @@ -140,7 +142,8 @@ function svgmath.convert(filename,svgstyle) local mode = info.mode local svgname = addsuffix(f_math_tmp(page),"svg") local action = mode == "inline" and f_inline or f_display - local x_div = xmlfirst(xmlconvert(action(-depth)),"/div") + -- local x_div = xmlfirst(xmlconvert(action(-depth)),"/div") + local x_div = xmlfirst(xmlconvert(action()),"/div") local svgdata = io.loaddata(svgname) if not svgdata or svgdata == "" then print("error in:",svgname,tostring(mth)) @@ -149,6 +152,10 @@ function svgmath.convert(filename,svgstyle) svgdata = lpegmatch(strip,svgdata) local x_svg = xmlfirst(xmlconvert(svgdata),"/svg") -- xmldelete(x_svg,"text") +if mode == "inline" then + x_svg.at.style = f_style(-depth) +end + x_div.dt = { x_svg } mth.__p__.dt[mth.ni] = x_div -- use helper end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 2bff7b0b6..fba5742b5 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 : 04/29/15 19:31:00 +-- merge date : 05/01/15 18:45:14 do -- begin closure to overcome local limits and interference -- cgit v1.2.3