diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-11 20:26:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-11 20:26:10 +0000 |
commit | e4ac240b2aab8cfa7e290e224e2837359ee089ca (patch) | |
tree | ef9fe92b5826efe43c86ccd1a2dc379e4fd9b343 /Master/texmf-dist/scripts/make4ht | |
parent | 5743624ea509ba5a2e1a933dc8e0327cc268ed8c (diff) |
make4ht (11oct21)
git-svn-id: svn://tug.org/texlive/trunk@60738 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht')
3 files changed, 31 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-mathmlfixes.lua b/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-mathmlfixes.lua index 55c0da379b0..42f1e557752 100644 --- a/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-mathmlfixes.lua +++ b/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-mathmlfixes.lua @@ -37,6 +37,30 @@ local function fix_nested_mstyle(el) end end +-- if element contains +-- wrap everything in <mrow> +local function top_mrow(math) + local children = math:get_children() + local put_mrow = false + -- don't process elements with one or zero children + -- don't process elements that already are mrow + if #children < 2 or math:get_element_name() == "mrow" then return nil end + for _,v in ipairs(children) do + if v:is_element() and is_token_element(v) then + put_mrow = true + break + end + end + if put_mrow then + local mrow = math:create_element("mrow") + for _, el in ipairs(children) do + mrow:add_child_node(el) + end + math._children = {mrow} + end + +end + local function get_fence(el, attr, form) -- convert fence attribute to <mo> element -- attr: open | close @@ -108,6 +132,7 @@ return function(dom) end fix_token_elements(el) fix_nested_mstyle(el) + top_mrow(el) end) return dom end diff --git a/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua b/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua index 257e597bb3a..f3721eba00b 100644 --- a/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua +++ b/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua @@ -127,7 +127,7 @@ local function fix_picture_sizes(tmpdir) end local content = f:read("*all") or "" f:close() - local status, domobject = pcall(function() + local status, dom= pcall(function() return domobject.parse(content) end) if not status then @@ -224,13 +224,13 @@ function M.modify_build(make) -- expanded in tex4ht.env in Miktex or Debian call_xtpipes(make) -- fix the image dimensions wrongly set by xtpipes - local domfilters = domfilter {"t4htlinks", "odtpartable"} + local domfilters = domfilter({"t4htlinks", "odtpartable"}, "odtfilters") make:match("4oo$", domfilters) - -- fixes for mathml - local mathmldomfilters = domfilter {"joincharacters","mathmlfixes"} - make:match("4om$", mathmldomfilters) -- execute it before xtpipes, because we don't want xtpipes to mess with t4htlink elements move_matches(make) + -- fixes for mathml + local mathmldomfilters = domfilter({"joincharacters","mathmlfixes"}, "mathmlfilters") + make:match("4om$", mathmldomfilters) -- convert XML entities for Unicode characters produced by Xtpipes to characters local fixentities = filter {"entities-to-unicode", remove_xtpipes} make:match("4oo", fixentities) diff --git a/Master/texmf-dist/scripts/make4ht/make4ht b/Master/texmf-dist/scripts/make4ht/make4ht index 1e7b0d73df0..74a9c22d2b9 100755 --- a/Master/texmf-dist/scripts/make4ht/make4ht +++ b/Master/texmf-dist/scripts/make4ht/make4ht @@ -29,7 +29,7 @@ make4ht [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex op"] -- set version number. the template should be replaced by the -- actual version number by the build script -local version = "v0.3i" +local version = "v0.3j" mkparams.version_number = version local args = mkparams.get_args() |