summaryrefslogtreecommitdiff
path: root/tex/context/base/node-tra.lua
diff options
context:
space:
mode:
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