summaryrefslogtreecommitdiff
path: root/tex/context/base/x-ct.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-04-23 19:20:16 +0300
committerMarius <mariausol@gmail.com>2012-04-23 19:20:16 +0300
commit4a3d6c259183d2e619d39c4f273d7c5489356113 (patch)
tree563f7ba81d1d601d43062198b82049be63df9e0c /tex/context/base/x-ct.lua
parent959400a677b3eb6ff6513a750be6dde943e62c36 (diff)
downloadcontext-4a3d6c259183d2e619d39c4f273d7c5489356113.tar.gz
beta 2012.04.23 15:58
Diffstat (limited to 'tex/context/base/x-ct.lua')
-rw-r--r--tex/context/base/x-ct.lua21
1 files changed, 16 insertions, 5 deletions
diff --git a/tex/context/base/x-ct.lua b/tex/context/base/x-ct.lua
index 1d0e63dae..2dee985c3 100644
--- a/tex/context/base/x-ct.lua
+++ b/tex/context/base/x-ct.lua
@@ -24,16 +24,27 @@ local halignments = {
justify = '',
}
+local templates = { }
+
+function moduledata.ct.registertabulatetemplate(name,str)
+ templates[name] = str
+end
+
local function roottemplate(root)
local rt = root.at.template
if rt then
- if not find(rt,"|") then
- rt = gsub(rt,",","|")
+ local template = templates[rt]
+ if template then
+ return template
+ else
+ if not find(rt,"|") then
+ rt = gsub(rt,",","|")
+ end
+ if not find(rt,"^|") then rt = "|" .. rt end
+ if not find(rt,"|$") then rt = rt .. "|" end
+ return rt
end
- if not find(rt,"^|") then rt = "|" .. rt end
- if not find(rt,"|$") then rt = rt .. "|" end
end
- return rt
end
local function specifiedtemplate(root,templatespec)