From 1b8f320120195d4a8a523c4bdba45d811bd81048 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 26 Apr 2020 20:17:14 +0200 Subject: 2020-04-26 19:56:00 --- tex/context/base/mkiv/math-frc.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tex/context/base/mkiv/math-frc.lua') diff --git a/tex/context/base/mkiv/math-frc.lua b/tex/context/base/mkiv/math-frc.lua index 190c36410..af30a03b5 100644 --- a/tex/context/base/mkiv/math-frc.lua +++ b/tex/context/base/mkiv/math-frc.lua @@ -55,3 +55,40 @@ interfaces.implement { actions = mathfraction, arguments = { "string", "number", "number", "dimen" } } + +-- experimental code in lmtx + +if CONTEXTLMTXMODE > 0 then + + local ctx_normalUatop = context.normalUatop + local ctx_normalUover = context.normalUover + + local function umathfraction(how,left,right,width) + if how == v_no then + if left == 0x002E and right == 0x002E then + ctx_normalUatop() + else + context("\\Uatopwithdelims%s%s",resolved[left],resolved[right]) + end + elseif how == v_yes then + if left == 0x002E and right == 0x002E then + context("\\normalUabove%ssp",width) + else + context("\\Uabovewithdelims%s%s%ssp",resolved[left],resolved[right],width) + end + else -- v_auto + if left == 0x002E and right == 0x002E then + ctx_normalUover() + else + context("\\Uoverwithdelims%s%s",resolved[left],resolved[right]) + end + end + end + + interfaces.implement { + name = "umathfraction", + actions = umathfraction, + arguments = { "string", "number", "number", "dimen" } + } + +end -- cgit v1.2.3