summaryrefslogtreecommitdiff
path: root/tex/context/base/node-tra.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-10-12 10:14:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-10-12 10:14:00 +0200
commit4680e3b1c502484cdba78372162dd4f51e398894 (patch)
treec90941ed8418d2ddadf7bbf01342857f705b3122 /tex/context/base/node-tra.lua
parentbd9c410acd522b2308bd5c4a60f7f7670ecfa6c9 (diff)
downloadcontext-4680e3b1c502484cdba78372162dd4f51e398894.tar.gz
beta 2011.10.12 10:14
Diffstat (limited to 'tex/context/base/node-tra.lua')
-rw-r--r--tex/context/base/node-tra.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index 5012095b3..3b5b1d018 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -643,15 +643,32 @@ local bpfactor = number.dimenfactors.bp
local stripper = lpeg.patterns.stripzeros
local points = function(n)
- return lpegmatch(stripper,format("%.5fpt",n*ptfactor))
+ if not n or n == 0 then
+ return "0pt"
+ else
+ return lpegmatch(stripper,format("%.5fpt",n*ptfactor))
+ end
end
local basepoints = function(n)
- return lpegmatch(stripper,format("%.5fbp",n*bpfactor))
+ if not n or n == 0 then
+ return "0bp"
+ else
+ return lpegmatch(stripper,format("%.5fbp",n*bpfactor))
+ end
+end
+
+local pts = function(n)
+ if not n or n == 0 then
+ return "0pt"
+ else
+ return format("%.5fpt",n*ptfactor)
+ end
end
number.points = points
number.basepoints = basepoints
+number.pts = pts
--~ function nodes.thespec(s)
--~ local stretch_order = s.stretch_order