From 4fb5c5e4e507761e57f663abd0e4dd9b4ee9fd5e Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 18 Aug 2014 14:09:05 -0400 Subject: [PATCH] Allow commas in place of decimals in TeX dimensions. Resolves issue #856. --- unpacked/jax/input/TeX/jax.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 2c8166f54..66a6caedb 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1653,7 +1653,7 @@ CrLaTeX: function (name) { var n; if (this.string.charAt(this.i) === "[") { - n = this.GetBrackets(name,"").replace(/ /g,""); + n = this.GetBrackets(name,"").replace(/ /g,"").replace(/,/,"."); if (n && !n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) { TEX.Error(["BracketMustBeDimension", @@ -1916,14 +1916,14 @@ if (this.nextIsSpace()) {this.i++} if (this.string.charAt(this.i) == '{') { dimen = this.GetArgument(name); - if (dimen.match(/^\s*([-+]?(\.\d+|\d+(\.\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)\s*$/)) - {return dimen.replace(/ /g,"")} + if (dimen.match(/^\s*([-+]?([.,]\d+|\d+([.,]\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)\s*$/)) + {return dimen.replace(/ /g,"").replace(/,/,".")} } else { dimen = this.string.slice(this.i); - var match = dimen.match(/^\s*(([-+]?(\.\d+|\d+(\.\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)) ?/); + var match = dimen.match(/^\s*(([-+]?([.,]\d+|\d+([.,]\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)) ?/); if (match) { this.i += match[0].length; - return match[1].replace(/ /g,""); + return match[1].replace(/ /g,"").replace(/,/,"."); } } TEX.Error(["MissingDimOrUnits",