summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-06-08 12:20:13 +0300
committerMarius <mariausol@gmail.com>2012-06-08 12:20:13 +0300
commit13f840f6ff972c4065f4ddf98f5f299f1fe566de (patch)
treed53451e983950d55313c2ec079fa2ef29a38202e /tex
parent901949f2e0eddb33046bc7628f831560cc380001 (diff)
downloadcontext-13f840f6ff972c4065f4ddf98f5f299f1fe566de.tar.gz
beta 2012.06.08 10:07
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/back-exp.lua5
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4147 -> 4141 bytes
-rw-r--r--tex/context/base/context-version.pngbin106124 -> 105215 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-ott.lua61
-rw-r--r--tex/context/base/m-spreadsheet.lua161
-rw-r--r--tex/context/base/m-spreadsheet.mkiv142
-rw-r--r--tex/context/base/status-files.pdfbin24431 -> 24391 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin181186 -> 181114 bytes
-rw-r--r--tex/context/base/tabl-tbl.mkiv4
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
14 files changed, 211 insertions, 172 deletions
diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua
index 3ce40a6c5..818f89e45 100644
--- a/tex/context/base/back-exp.lua
+++ b/tex/context/base/back-exp.lua
@@ -20,6 +20,7 @@ if not modules then modules = { } end modules ['back-exp'] = {
local next, type = next, type
local format, match, concat, rep, sub, gsub, gmatch, find = string.format, string.match, table.concat, string.rep, string.sub, string.gsub, string.gmatch, string.find
+local validstring = string.valid
local lpegmatch = lpeg.match
local utfchar, utfbyte, utfsub, utfgsub = utf.char, utf.byte, utf.sub, utf.gsub
local insert, remove = table.insert, table.remove
@@ -2362,12 +2363,16 @@ local function stopexport(v)
report_export("saving xhtml variant in '%s",xhtmlfile)
local xmltree = cleanxhtmltree(xml.convert(results))
xml.save(xmltree,xhtmlfile)
+ local identity = interactions.general.getidentity()
local specification = {
name = file.removesuffix(v),
identifier = os.uuid(),
images = uniqueusedimages(),
root = xhtmlfile,
files = files,
+ language = languagenames[tex.count.mainlanguagenumber],
+ title = validstring(identity.title),
+ author = validstring(identity.author),
}
report_export("saving specification in '%s' (mtxrun --script epub --make %s)",specificationfilename,specificationfilename)
io.savedata(specificationfilename,table.serialize(specification,true))
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index a3e06dc9c..6fde41a34 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.06.07 18:39}
+\newcontextversion{2012.06.08 10:07}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 877476dfa..fe8415046 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.06.07 18:39}
+\newcontextversion{2012.06.08 10:07}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 435109161..2e807d6bc 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index edd9c1c6d..655ba8d0a 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index e99a9b930..29574a248 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.06.07 18:39}
+\edef\contextversion{2012.06.08 10:07}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index d0f5084e7..5b8c6d55d 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -23,7 +23,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.06.07 18:39}
+\edef\contextversion{2012.06.08 10:07}
%D For those who want to use this:
diff --git a/tex/context/base/font-ott.lua b/tex/context/base/font-ott.lua
index 6c671d76f..1e4bd69af 100644
--- a/tex/context/base/font-ott.lua
+++ b/tex/context/base/font-ott.lua
@@ -577,26 +577,26 @@ local features = allocate {
['size'] = 'optical size',
['smcp'] = 'small capitals',
['smpl'] = 'simplified forms',
- ['ss01'] = 'stylistic set 1',
- ['ss02'] = 'stylistic set 2',
- ['ss03'] = 'stylistic set 3',
- ['ss04'] = 'stylistic set 4',
- ['ss05'] = 'stylistic set 5',
- ['ss06'] = 'stylistic set 6',
- ['ss07'] = 'stylistic set 7',
- ['ss08'] = 'stylistic set 8',
- ['ss09'] = 'stylistic set 9',
- ['ss10'] = 'stylistic set 10',
- ['ss11'] = 'stylistic set 11',
- ['ss12'] = 'stylistic set 12',
- ['ss13'] = 'stylistic set 13',
- ['ss14'] = 'stylistic set 14',
- ['ss15'] = 'stylistic set 15',
- ['ss16'] = 'stylistic set 16',
- ['ss17'] = 'stylistic set 17',
- ['ss18'] = 'stylistic set 18',
- ['ss19'] = 'stylistic set 19',
- ['ss20'] = 'stylistic set 20',
+ -- ['ss01'] = 'stylistic set 1',
+ -- ['ss02'] = 'stylistic set 2',
+ -- ['ss03'] = 'stylistic set 3',
+ -- ['ss04'] = 'stylistic set 4',
+ -- ['ss05'] = 'stylistic set 5',
+ -- ['ss06'] = 'stylistic set 6',
+ -- ['ss07'] = 'stylistic set 7',
+ -- ['ss08'] = 'stylistic set 8',
+ -- ['ss09'] = 'stylistic set 9',
+ -- ['ss10'] = 'stylistic set 10',
+ -- ['ss11'] = 'stylistic set 11',
+ -- ['ss12'] = 'stylistic set 12',
+ -- ['ss13'] = 'stylistic set 13',
+ -- ['ss14'] = 'stylistic set 14',
+ -- ['ss15'] = 'stylistic set 15',
+ -- ['ss16'] = 'stylistic set 16',
+ -- ['ss17'] = 'stylistic set 17',
+ -- ['ss18'] = 'stylistic set 18',
+ -- ['ss19'] = 'stylistic set 19',
+ -- ['ss20'] = 'stylistic set 20',
['ssty'] = 'script style', -- math
['subs'] = 'subscript',
['sups'] = 'superscript',
@@ -622,7 +622,13 @@ local features = allocate {
['trep'] = 'traditional tex replacements',
['tlig'] = 'traditional tex ligatures',
- ['ss'] = 'stylistic set %s',
+ -- ['ss'] = 'stylistic set %s',
+ -- ['cv'] = 'character variant %s',
+ -- ['js'] = 'justification %s',
+
+ ['ss..'] = 'stylistic set ..',
+ ['cv..'] = 'character variant ..',
+ ['js..'] = 'justification ..',
}
local baselines = allocate {
@@ -750,7 +756,12 @@ local function resolve(t,k)
if tag and dd then
local v = rawget(t,tag)
if v then
- return format(v,tonumber(dd))
+ return format(v,tonumber(dd)) -- old way
+ else
+ local v = rawget(t,tag.."..") -- nicer in overview
+ if v then
+ return (gsub(v,"%.%.",tonumber(dd))) -- new way
+ end
end
end
end
@@ -760,10 +771,10 @@ end
setmetatableindex(features, resolve)
local function assign(t,k,v)
- if k then
+ if k and v then
v = lower(v)
- rawset(t,k,v)
- rawset(features,gsub(v,"[^a-z0-9]",""),k)
+ rawset(t,k,v) -- rawset ?
+ -- rawset(features,gsub(v,"[^a-z0-9]",""),k) -- why ? old code
end
end
diff --git a/tex/context/base/m-spreadsheet.lua b/tex/context/base/m-spreadsheet.lua
new file mode 100644
index 000000000..7a74b594b
--- /dev/null
+++ b/tex/context/base/m-spreadsheet.lua
@@ -0,0 +1,161 @@
+if not modules then modules = { } end modules ['m-spreadsheet'] = {
+ version = 1.001,
+ comment = "companion to m-spreadsheet.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local byte, format, gsub, validstring = string.byte, string.format, string.gsub, string.valid
+local R, P, C, Cs, Cc, Carg, lpegmatch = lpeg.R, lpeg.P, lpeg.C, lpeg.Cs, lpeg.Cc, lpeg.Carg, lpeg.match
+
+local context = context
+
+moduledata = moduledata or { }
+
+local spreadsheets = { }
+moduledata.spreadsheets = spreadsheets
+
+local data = {
+ -- nothing yet
+}
+
+local settings = {
+ numberseparator = ".",
+}
+
+spreadsheets.data = data
+spreadsheets.settings = settings
+
+local stack, current = { }, "default"
+
+local mt ; mt = {
+ __index = function(t,k)
+ local v = { }
+ setmetatable(v,mt)
+ t[k] = v
+ return v
+ end,
+}
+
+function spreadsheets.reset(name)
+ if not name or name == "" then name = "default" end
+ local d = { }
+ setmetatable(d,mt)
+ data[name] = d
+end
+
+function spreadsheets.start(name)
+ if not name or name == "" then name = "default" end
+ table.insert(stack,current)
+ current = name
+ if not data[current] then
+ local d = { }
+ setmetatable(d,mt)
+ data[current] = d
+ end
+end
+
+function spreadsheets.stop()
+ current = table.remove(stack)
+end
+
+spreadsheets.reset()
+
+local offset = byte("A") - 1
+
+local function assign(s,n)
+ return format("moduledata.spreadsheets.data['%s'][%s]",n,byte(s)-offset)
+end
+
+-------- datacell(name,a,b,...)
+function datacell(a,b,...)
+ local n = 0
+ if b then
+ local t = { a, b, ... }
+ for i=1,#t do
+ n = n * (i-1) * 26 + byte(t[i]) - offset
+ end
+ else
+ n = byte(a) - offset
+ end
+ -- return format("dat['%s'][%s]",name,n)
+ return format("dat[%s]",n)
+end
+
+----- cell = (Carg(1) * C(R("AZ"))^1) / datacell * (Cc("[") * (R("09")^1) * Cc("]") + #P(1))
+local cell = C(R("AZ"))^1 / datacell * (Cc("[") * (R("09")^1) * Cc("]") + #P(1))
+local pattern = Cs(Cc("return ") * (cell + P(1))^0)
+
+local functions = { }
+spreadsheets.functions = functions
+
+function functions.sum(c,f,t)
+ if f and t then
+ local r = 0
+ for i=f,t do
+ r = r + c[i]
+ end
+ return r
+ else
+ return 0
+ end
+end
+
+function functions.fmt(pattern,n)
+ return format("%"..pattern,n)
+end
+
+local template = [[
+ local spr = moduledata.spreadsheets.functions
+ local dat = moduledata.spreadsheets.data['%s']
+ local sum = spr.sum
+ local fmt = spr.fmt
+ %s
+]]
+
+local function execute(name,r,c,str)
+ if name == "" then name = current if name == "" then name = "default" end end
+ str = lpegmatch(pattern,str,1,name)
+ str = format(template,name,str)
+ -- print(str)
+ local result = loadstring(str)
+ result = result and result() or 0
+ data[name][c][r] = result
+ return result
+end
+
+function spreadsheets.set(name,r,c,str)
+ if name == "" then name = current if name == "" then name = "default" end end
+ execute(name,r,c,str)
+end
+
+function spreadsheets.get(name,r,c,str)
+ if name == "" then name = current if name == "" then name = "default" end end
+ if not str or str == "" then
+ context(data[name][c][r] or 0)
+ else
+ local result = execute(name,r,c,str)
+ if result then
+ if type(result) == "number" then
+ data[name][c][r] = result
+ end
+ local numberseparator = validstring(settings.numberseparator,".")
+ if numberseparator ~= "." then
+ result = gsub(tostring(result),"%.",numberseparator)
+ end
+ context(result)
+ end
+ end
+end
+
+function spreadsheets.doifelsecell(name,r,c)
+ if name == "" then name = current if name == "" then name = "default" end end
+ local d = data[name]
+ commands.testcase(d and d[c][r])
+end
+
+function spreadsheets.show(name)
+ if name == "" then name = current if name == "" then name = "default" end end
+ table.print(data[name],name)
+end
diff --git a/tex/context/base/m-spreadsheet.mkiv b/tex/context/base/m-spreadsheet.mkiv
index 839214096..45e14ef39 100644
--- a/tex/context/base/m-spreadsheet.mkiv
+++ b/tex/context/base/m-spreadsheet.mkiv
@@ -13,145 +13,7 @@
%D This is an experimental follow up on discussion on the mailing list.
-\startluacode
-local byte, format = string.byte, string.format
-local R, P, C, Cs, Cc, Carg, lpegmatch = lpeg.R, lpeg.P, lpeg.C, lpeg.Cs, lpeg.Cc, lpeg.Carg, lpeg.match
-
-local spreadsheets = { }
-moduledata.spreadsheets = spreadsheets
-
-local data = { }
-spreadsheets.data = data
-
-local stack, current = { }, "default"
-
-local mt ; mt = {
- __index = function(t,k)
- local v = { }
- setmetatable(v,mt)
- t[k] = v
- return v
- end,
-}
-
-function spreadsheets.reset(name)
- if not name or name == "" then name = "default" end
- local d = { }
- setmetatable(d,mt)
- data[name] = d
-end
-
-function spreadsheets.start(name)
- if not name or name == "" then name = "default" end
- table.insert(stack,current)
- current = name
- if not data[current] then
- local d = { }
- setmetatable(d,mt)
- data[current] = d
- end
-end
-
-function spreadsheets.stop()
- current = table.remove(stack)
-end
-
-spreadsheets.reset()
-
-local offset = byte("A") - 1
-
-local function assign(s,n)
- return format("moduledata.spreadsheets.data['%s'][%s]",n,byte(s)-offset)
-end
-
--------- datacell(name,a,b,...)
-function datacell(a,b,...)
- local n = 0
- if b then
- local t = { a, b, ... }
- for i=1,#t do
- n = n * (i-1) * 26 + byte(t[i]) - offset
- end
- else
- n = byte(a) - offset
- end
- -- return format("dat['%s'][%s]",name,n)
- return format("dat[%s]",n)
-end
-
------ cell = (Carg(1) * C(R("AZ"))^1) / datacell * (Cc("[") * (R("09")^1) * Cc("]") + #P(1))
-local cell = C(R("AZ"))^1 / datacell * (Cc("[") * (R("09")^1) * Cc("]") + #P(1))
-local pattern = Cs(Cc("return ") * (cell + P(1))^0)
-
-local functions = { }
-spreadsheets.functions = functions
-
-function functions.sum(c,f,t)
- if f and t then
- local r = 0
- for i=f,t do
- r = r + c[i]
- end
- return r
- else
- return 0
- end
-end
-
-function functions.fmt(pattern,n)
- return format("%"..pattern,n)
-end
-
-local template = [[
- local spr = moduledata.spreadsheets.functions
- local dat = moduledata.spreadsheets.data['%s']
- local sum = spr.sum
- local fmt = spr.fmt
- %s
-]]
-
-local function execute(name,r,c,str)
- if name == "" then name = current if name == "" then name = "default" end end
- str = lpegmatch(pattern,str,1,name)
- str = format(template,name,str)
- -- print(str)
- local result = loadstring(str)
- result = result and result() or 0
- data[name][c][r] = result
- return result
-end
-
-function spreadsheets.set(name,r,c,str)
- if name == "" then name = current if name == "" then name = "default" end end
- execute(name,r,c,str)
-end
-
-function spreadsheets.get(name,r,c,str)
- if name == "" then name = current if name == "" then name = "default" end end
- if not str or str == "" then
- context(data[name][c][r] or 0)
- else
- local result = execute(name,r,c,str)
- if result then
- if type(result) == "number" then
- data[name][c][r] = result
- end
- context(result)
- end
- end
-end
-
-function spreadsheets.doifelsecell(name,r,c)
- if name == "" then name = current if name == "" then name = "default" end end
- local d = data[name]
- commands.testcase(d and d[c][r])
-end
-
-function spreadsheets.show(name)
- if name == "" then name = current if name == "" then name = "default" end end
- table.print(data[name],name)
-end
-\stopluacode
+\registerctxluafile{m-spreadsheet}{1.001}
\unprotect
@@ -198,7 +60,7 @@ end
\protect
-\doifnotmode{demo}{\endinput}
+\continueifinputfile{m-spreadsheet.mkiv}
\starttext
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 9155dbeef..f41c2c98d 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 466493324..5ed908d42 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv
index 20ddac461..489287727 100644
--- a/tex/context/base/tabl-tbl.mkiv
+++ b/tex/context/base/tabl-tbl.mkiv
@@ -1904,10 +1904,10 @@
{\c_tabl_tabulate_pass\plusone
\tabl_tabulate_check_full_content
\edef\v_tabl_tabulate_align{\executeifdefined{\??tabulatealigning\p_align}0}%
- \s_tabl_tabulate_post\zeropoint
- \s_tabl_tabulate_pre\zeropoint
\s_tabl_tabulate_first.5\d_tabl_tabulate_unit
\s_tabl_tabulate_last\s_tabl_tabulate_first
+ \s_tabl_tabulate_pre\zeropoint
+ \s_tabl_tabulate_post\s_tabl_tabulate_first % was: \zeropoint
\global\c_tabl_tabulate_columns\zerocount
\global\c_tabl_tabulate_nofauto\zerocount
\global\c_tabl_tabulate_noflines\zerocount
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index a51f460ae..ce772abe7 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 06/07/12 18:39:35
+-- merge date : 06/08/12 10:07:44
do -- begin closure to overcome local limits and interference