www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ed624f333d4196fda658de4439374aee5565f477
parent 92fd8955828e0c24ad031b9b3986f861abe965b7
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon, 10 Feb 2014 08:40:06 -0500

Merge branch 'issue459' into develop.  Issue #459.

Diffstat:
Munpacked/jax/input/TeX/jax.js | 2++
Munpacked/jax/output/HTML-CSS/config.js | 14++++++++++++++
Munpacked/jax/output/HTML-CSS/jax.js | 8++++++--
Munpacked/jax/output/SVG/config.js | 13+++++++++++++
Munpacked/jax/output/SVG/jax.js | 3+++
5 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js @@ -935,6 +935,8 @@ textrm: ['Macro','\\mathord{\\rm\\text{#1}}',1], textit: ['Macro','\\mathord{\\it{\\text{#1}}}',1], textbf: ['Macro','\\mathord{\\bf{\\text{#1}}}',1], + textsf: ['Macro','\\mathord{\\sf{\\text{#1}}}',1], + texttt: ['Macro','\\mathord{\\tt{\\text{#1}}}',1], pmb: ['Macro','\\rlap{#1}\\kern1px{#1}',1], TeX: ['Macro','T\\kern-.14em\\lower.5ex{E}\\kern-.115em X'], LaTeX: ['Macro','L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX'], diff --git a/unpacked/jax/output/HTML-CSS/config.js b/unpacked/jax/output/HTML-CSS/config.js @@ -75,6 +75,20 @@ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({ "font-size": "90%" }, + // + // For mtextFontInherit version of \texttt{} + // + ".MathJax .MJX-monospace": { + "font-family": "monospace" + }, + + // + // For mtextFontInherit version of \textsf{} + // + ".MathJax .MJX-sans-serif": { + "font-family": "sans-serif" + }, + "#MathJax_Tooltip": { "background-color": "InfoBackground", color: "InfoText", border: "1px solid black", diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -2170,8 +2170,12 @@ span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); var variant = this.HTMLgetVariant(); // Avoid setting the font style for error text or if mtextFontInherit is set - if (HTMLCSS.config.mtextFontInherit || this.Parent().type === "merror") - {variant = {bold:variant.bold, italic:variant.italic, fontInherit: true}} + if (HTMLCSS.config.mtextFontInherit || this.Parent().type === "merror") { + var vname = this.Get("mathvariant"); + if (vname === "monospace") {span.className += " MJX-monospace"} + else if (vname.match(/sans-serif/)) {span.className += " MJX-sans-serif"} + variant = {bold:variant.bold, italic:variant.italic, fontInherit: true}; + } for (var i = 0, m = this.data.length; i < m; i++) {if (this.data[i]) {this.data[i].toHTML(span,variant)}} if (!span.bbox) {span.bbox = this.HTMLzeroBBox()} diff --git a/unpacked/jax/output/SVG/config.js b/unpacked/jax/output/SVG/config.js @@ -64,6 +64,19 @@ MathJax.OutputJax.SVG = MathJax.OutputJax({ margin: "1em 0em" }, + // + // For mtextFontInherit version of \texttt{} + // + ".MathJax_SVG .MJX-monospace": { + "font-family": "monospace" + }, + + // + // For mtextFontInherit version of \textsf{} + // + ".MathJax_SVG .MJX-sans-serif": { + "font-family": "sans-serif" + }, "#MathJax_SVG_Tooltip": { "background-color": "InfoBackground", color: "InfoText", border: "1px solid black", diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js @@ -1483,6 +1483,9 @@ var variant = this.SVGgetVariant(), def = {direction:this.Get("dir")}; if (variant.bold) {def["font-weight"] = "bold"} if (variant.italic) {def["font-style"] = "italic"} + variant = this.Get("mathvariant"); + if (variant === "monospace") {def["class"] = "MJX-monospace"} + else if (variant.match(/sans-serif/)) {def["class"] = "MJX-sans-serif"} svg.Add(BBOX.TEXT(scale,this.data.join(""),def)); svg.Clean(); this.SVGhandleColor(svg); this.SVGsaveData(svg);