summaryrefslogtreecommitdiff
path: root/tex/context/base/math-tag.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-10-08 16:51:00 +0530
committerHans Hagen <pragma@wxs.nl>2014-10-08 16:51:00 +0530
commit45cca8b255d3a5816230095ad0395a6d1dc2cdba (patch)
tree65104781fe8a56bd76400e136526fc97c8c61328 /tex/context/base/math-tag.lua
parent4d782ec7e30ef87dcfd0be14904ab5217e564320 (diff)
downloadcontext-45cca8b255d3a5816230095ad0395a6d1dc2cdba.tar.gz
beta 2014.10.08 16:51
Diffstat (limited to 'tex/context/base/math-tag.lua')
-rw-r--r--tex/context/base/math-tag.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/tex/context/base/math-tag.lua b/tex/context/base/math-tag.lua
index 6b555650e..26782bd9c 100644
--- a/tex/context/base/math-tag.lua
+++ b/tex/context/base/math-tag.lua
@@ -64,6 +64,8 @@ local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local math_code = nodecodes.math
+local processnoads = noads.process
+
local a_tagged = attributes.private('tagged')
local a_taggedpar = attributes.private('taggedpar')
local a_exportstatus = attributes.private('exportstatus')
@@ -144,6 +146,21 @@ local function getunicode(n) -- instead of getchar
return data.unicode or char
end
+-------------------
+
+local content = { }
+local found = false
+
+content[math_char_code] = function() found = true end
+
+local function hascontent(head)
+ found = false
+ processnoads(head,content,"content")
+ return found
+end
+
+--------------------
+
process = function(start) -- we cannot use the processor as we have no finalizers (yet)
local mtexttag = nil
while start do
@@ -423,7 +440,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
process(left) -- root symbol, ignored
stop_tagged()
end
- if degree then -- not good enough, can be empty mlist
+ if degree and hascontent(degree) then
setattr(start,a_tagged,start_tagged("mroot"))
processsubsup(start)
process(degree)