summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-asciimath.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-asciimath.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua
index efa6a7736d6..51f401e6640 100644
--- a/Master/texmf-dist/tex/context/base/x-asciimath.lua
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua
@@ -1817,7 +1817,7 @@ local uncrapped = {
["_"] = "\\underline{\\enspace}",
}
-local function convert(str)
+local function convert(str,nowrap)
if #str > 0 then
local unicoded = lpegmatch(u_parser,str) or str
if lpegmatch(p_onechar,unicoded) then
@@ -1834,6 +1834,8 @@ local function convert(str)
if message then
report_asciimath("%s: %s : %s",message,str,texcoded)
ctx_type(formatters["<%s>"](message))
+ elseif nowrap then
+ context(texcoded)
else
ctx_mathematics(texcoded)
end
@@ -1936,11 +1938,17 @@ if not context then
end
interfaces.implement {
- name = "asciimath", -- module_asciimath_convert
+ name = "asciimath",
actions = convert,
arguments = "string"
}
+interfaces.implement {
+ name = "justasciimath",
+ actions = convert,
+ arguments = { "string", true },
+}
+
local ctx_typebuffer = context.typebuffer
local ctx_mathematics = context.mathematics
local ctx_color = context.color