summaryrefslogtreecommitdiff
path: root/tex/context/base/cldf-com.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-11-12 18:22:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-11-12 18:22:00 +0100
commit953cd0a613be25ad37baaa745758862262e46395 (patch)
treed599c351e258d4ef3257b1de3912ad5843ae6dfc /tex/context/base/cldf-com.lua
parent026f0c26fedd2cd2b96ff9eca5ec7961956b3630 (diff)
downloadcontext-953cd0a613be25ad37baaa745758862262e46395.tar.gz
beta 2010.11.12 18:22
Diffstat (limited to 'tex/context/base/cldf-com.lua')
-rw-r--r--tex/context/base/cldf-com.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/tex/context/base/cldf-com.lua b/tex/context/base/cldf-com.lua
index 3bbeabb0f..5ab1d8c8d 100644
--- a/tex/context/base/cldf-com.lua
+++ b/tex/context/base/cldf-com.lua
@@ -6,8 +6,45 @@ if not modules then modules = { } end modules ['cldf-com'] = {
license = "see context related readme files"
}
+local context = context
local generics = context.generics
local variables = interfaces.variables
generics.starttabulate = "start" .. variables.tabulate -- todo: e!start
generics.stoptabulate = "stop" .. variables.tabulate -- todo: e!stop
+
+local NC, NR = context.NC, context.NR
+
+local function tabulaterow(how,...)
+ local t = { ... }
+ for i=1,#t do
+ local ti = tostring(t[i])
+ NC()
+ if how then
+ context[how](ti)
+ else
+ context(ti)
+ end
+ end
+ NC()
+ NR()
+end
+
+function context.tabulaterow (...) tabulaterow(false, ...) end
+function context.tabulaterowbold(...) tabulaterow("bold",...) end
+function context.tabulaterowtype(...) tabulaterow("type",...) end
+function context.tabulaterowtyp (...) tabulaterow("typ", ...) end
+
+function context.concat(t,separator)
+ local done = false
+ for i=1,#t do
+ local ti = t[i]
+ if ti ~= "" then
+ if done then
+ context(separator)
+ end
+ context(t)
+ done = true
+ end
+ end
+end