Skip to content

Commit 8f6a5af

Browse files
committed
Merge branch 'master' into use_mathchoice
2 parents f8723e2 + 06b3ff6 commit 8f6a5af

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

lib/Mml-lab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Lab = window.Lab = {
2626
Typeset() {
2727
let MML = this.mml.value;
2828
let math = new LabMathItem(MML,mml);
29-
math.setMetrics(16,8,1000000,100000,1);
29+
math.setMetrics(16,8,16*20,100000,1);
3030
math.display = this.display;
3131
this.jax = math;
3232

lib/TeX-lab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Lab = window.Lab = {
2626
Typeset() {
2727
let TeX = this.tex.value;
2828
let math = new LabMathItem(TeX,tex);
29-
math.setMetrics(16,8,1000000,100000,1);
29+
math.setMetrics(16,8,16*20,100000,1);
3030
math.display = this.display;
3131
this.jax = math;
3232

main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import {MathJax} from "mathjax3/mathjax.js";
22
export {MathJax} from "mathjax3/mathjax.js";
33

4-
import "mathjax3/handlers/html.js";
54
import {TeX} from "mathjax3/input/tex.js";
5+
import {RegisterHTMLHandler} from "mathjax3/handlers/html.js";
6+
import {chooseAdaptor} from "mathjax3/adaptors/chooseAdaptor.js";
67
import {CHTML} from "mathjax3/output/chtml.js";
78

8-
let html = MathJax.Document("<html></html>", {
9+
RegisterHTMLHandler(chooseAdaptor());
10+
11+
let html = MathJax.document("<html></html>", {
912
InputJax: new TeX(),
1013
OutputJax: new CHTML()
1114
});
1215

13-
MathJax.HandleRetriesFor(function () {
16+
MathJax.handleRetriesFor(function () {
1417

15-
html.TestMath(process.argv[3] || '').Compile().Typeset();
18+
html.TestMath(process.argv[3] || '').compile().typeset();
1619
let math = html.math.pop();
1720
console.log(math.typeset.outerHTML);
1821

mathjax2/legacy/jax/element/MmlNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
return node;
3030
},
3131
nodeMake: function (factory,kind) {
32-
var node = factory.MML[kind]();
32+
var node = factory.MML[kind === 'TeXmathchoice' ? 'mathchoice' : kind]();
3333
var data = (this.data[0] && this.data[0].inferred && this.inferRow ? this.data[0].data : this.data);
3434
for (var i = 0, m = data.length; i < m; i++) {
3535
var child = data[i];

mathjax3-ts/core/MathItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export type Location<N, T> = {
4747

4848
/*****************************************************************/
4949
/*
50-
* The Metrics object includes tht data needed to typeset
50+
* The Metrics object includes the data needed to typeset
5151
* a Mathitem.
5252
*/
5353

mathjax3-ts/output/chtml/Wrapper.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,24 +653,32 @@ export class CHTMLWrapper<N, T, D> extends AbstractWrapper<MmlNode, CHTMLWrapper
653653
*/
654654

655655
public drawBBox() {
656-
const bbox = this.getBBox();
656+
let {w, h, d, R} = this.getBBox();
657657
const box = this.html('mjx-box', {style: {
658-
opacity: .25, 'margin-left': this.em(-bbox.w - bbox.R)
658+
opacity: .25, 'margin-left': this.em(-w - R)
659659
}}, [
660660
this.html('mjx-box', {style: {
661-
height: this.em(bbox.h),
662-
width: this.em(bbox.w),
661+
height: this.em(h),
662+
width: this.em(w),
663663
'background-color': 'red'
664664
}}),
665665
this.html('mjx-box', {style: {
666-
height: this.em(bbox.d),
667-
width: this.em(bbox.w),
668-
'margin-left': this.em(-bbox.w),
669-
'vertical-align': this.em(-bbox.d),
666+
height: this.em(d),
667+
width: this.em(w),
668+
'margin-left': this.em(-w),
669+
'vertical-align': this.em(-d),
670670
'background-color': 'green'
671671
}})
672672
] as N[]);
673673
const node = this.chtml || this.parent.chtml;
674+
const size = this.adaptor.getAttribute(node, 'size');
675+
if (size) {
676+
this.adaptor.setAttribute(box, 'size', size);
677+
}
678+
const fontsize = this.adaptor.getStyle(node, 'fontSize');
679+
if (fontsize) {
680+
this.adaptor.setStyle(box, 'fontSize', fontsize);
681+
}
674682
this.adaptor.append(this.adaptor.parent(node), box);
675683
this.adaptor.setStyle(node, 'backgroundColor', '#FFEE00');
676684
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"tslint-jsdoc-rules": "*",
2121
"tslint-unix-formatter": "*",
2222
"typescript-tools": "^0.3.1",
23-
"typedoc": "^0.9.0"
2423
},
2524
"repository": {
2625
"type": "git",

0 commit comments

Comments
 (0)