Prevent breaks right before a closing fence or right after an open fence.
This commit is contained in:
parent
5968ef8b74
commit
1f5b1854e5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,7 +41,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
spacefactor: -100,
|
spacefactor: -100,
|
||||||
spaceoffset: 2,
|
spaceoffset: 2,
|
||||||
spacelimit: 1, // spaces larger than this get a penalty boost
|
spacelimit: 1, // spaces larger than this get a penalty boost
|
||||||
fence: 500
|
fence: 500,
|
||||||
|
close: 500
|
||||||
};
|
};
|
||||||
|
|
||||||
var ENDVALUES = {linebreakstyle: "after"};
|
var ENDVALUES = {linebreakstyle: "after"};
|
||||||
|
@ -408,6 +409,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
var penalty = Math.floor(offset / HTMLCSS.linebreakWidth * 1000);
|
var penalty = Math.floor(offset / HTMLCSS.linebreakWidth * 1000);
|
||||||
if (penalty < 0) {penalty = PENALTY.toobig - 3*penalty}
|
if (penalty < 0) {penalty = PENALTY.toobig - 3*penalty}
|
||||||
if (values.fence) {penalty += PENALTY.fence}
|
if (values.fence) {penalty += PENALTY.fence}
|
||||||
|
if ((values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER &&
|
||||||
|
values.texClass === MML.TEXCLASS.OPEN) ||
|
||||||
|
values.texClass === MML.TEXCLASS.CLOSE) {penalty += PENALTY.close}
|
||||||
penalty += info.nest * PENALTY.nestfactor;
|
penalty += info.nest * PENALTY.nestfactor;
|
||||||
//
|
//
|
||||||
// Get the penalty for this type of break and
|
// Get the penalty for this type of break and
|
||||||
|
|
|
@ -42,7 +42,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
||||||
spacefactor: -100,
|
spacefactor: -100,
|
||||||
spaceoffset: 2,
|
spaceoffset: 2,
|
||||||
spacelimit: 1, // spaces larger than this get a penalty boost
|
spacelimit: 1, // spaces larger than this get a penalty boost
|
||||||
fence: 500
|
fence: 500,
|
||||||
|
close: 500
|
||||||
};
|
};
|
||||||
|
|
||||||
var ENDVALUES = {linebreakstyle: "after"};
|
var ENDVALUES = {linebreakstyle: "after"};
|
||||||
|
@ -365,6 +366,9 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
||||||
var penalty = Math.floor(offset / SVG.linebreakWidth * 1000);
|
var penalty = Math.floor(offset / SVG.linebreakWidth * 1000);
|
||||||
if (penalty < 0) {penalty = PENALTY.toobig - 3*penalty}
|
if (penalty < 0) {penalty = PENALTY.toobig - 3*penalty}
|
||||||
if (values.fence) {penalty += PENALTY.fence}
|
if (values.fence) {penalty += PENALTY.fence}
|
||||||
|
if ((values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER &&
|
||||||
|
values.texClass === MML.TEXCLASS.OPEN) ||
|
||||||
|
values.texClass === MML.TEXCLASS.CLOSE) {penalty += PENALTY.close}
|
||||||
penalty += info.nest * PENALTY.nestfactor;
|
penalty += info.nest * PENALTY.nestfactor;
|
||||||
//
|
//
|
||||||
// Get the penalty for this type of break and
|
// Get the penalty for this type of break and
|
||||||
|
|
Loading…
Reference in New Issue
Block a user