summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua')
-rw-r--r--Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua b/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
index eb266a1e9fc..97a90acedb7 100644
--- a/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
+++ b/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
@@ -13,9 +13,27 @@ local function escape_string(str)
return str
end
+local ltx
+local function get_ltx()
+ if not ltx then
+ ltx = _ENV.ltx
+ if not ltx then
+ tex.error("LaTeX PDF support not loaded", {"Maybe try adding \\DocumentMetadata."})
+ ltx = {pdf = {object_id = function() return 0 end}}
+ end
+ end
+ return ltx
+end
+
local mathml_ns_obj
local function get_mathml_ns_obj()
- mathml_ns_obj = mathml_ns_obj or token.create'c__pdf_backend_object_tag/NS/mathml_int'.index
+ if not mathml_ns_obj then
+ mathml_ns_obj = get_ltx().pdf.object_id'tag/NS/mathml'
+ if not mathml_ns_obj then
+ tex.error("Failed to find MathML namespace", {"The PDF support does not know the mathml namespace"})
+ mathml_ns_obj = 0
+ end
+ end
return mathml_ns_obj
end