commit 8c0f8443336c1f7cb0c40cfa4ab6b83b8218839e
parent 86792eaf44afc7d6311209f1932a4624016c9819
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 14 Feb 2014 14:56:15 -0500
Allow switching of phi and varphi (new fixphi configuration parameter controls this). Resolves issue #353.
Diffstat:
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/unpacked/config/default.js b/unpacked/config/default.js
@@ -570,6 +570,14 @@ MathJax.Hub.Config({
//
AsciiMath: {
//
+ // Determines whether the unicode positions for phi and varphi are
+ // to be swapped or not. (Unicode originally had these reversed, and
+ // many fonts have them reversed as well.) When set to true, phi
+ // and varphi will correspond to the LaTeX macros of the same name.
+ //
+ fixphi: true,
+
+ //
// Determines whether limits are placed above and below operators,
// or next to them. (AsciiMath doesn't have separate in-line and
// display modes like TeX and MathML do, so this is the only control
diff --git a/unpacked/jax/input/AsciiMath/config.js b/unpacked/jax/input/AsciiMath/config.js
@@ -35,6 +35,7 @@ MathJax.InputJax.AsciiMath = MathJax.InputJax({
extensionDir: MathJax.InputJax.extensionDir + "/AsciiMath",
config: {
+ fixphi: true, // switch phi and varphi unicode values
displaystyle: true, // put limits above and below operators
decimalsign: "." // can change to "," but watch out for "(1,2)"
}
diff --git a/unpacked/jax/input/AsciiMath/jax.js b/unpacked/jax/input/AsciiMath/jax.js
@@ -1199,6 +1199,11 @@ ASCIIMATH.Augment({
// Old versions use the "decimal" option, so take it into account if it
// is defined by the user. See issue 384.
decimalsign = (ASCIIMATH.config.decimal || ASCIIMATH.config.decimalsign);
+ // fix pi and var phi, if requested
+ for (var i = 0, m = AMsymbols.length; i < m; i++) {
+ if (AMsymbols[i].input === "phi") {AMsymbols[i].output = "\u03D5"}
+ if (AMsymbols[i].input === "varphi") {AMsymbols[i].output = "\u03C6"; i = m}
+ }
INITASCIIMATH();
AMinitSymbols();
},