Allow \\ anywhere (not just in arrays) to force a line break.

This commit is contained in:
Davide P. Cervone 2011-11-20 19:21:07 -05:00
parent c223b6bc8c
commit 66ec3254ee
8 changed files with 14 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -88,7 +88,10 @@
},
checkItem: function (item) {
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(FALSE); this.data = []}
if (item.type === "cell" && this.isOpen) {TEX.Error("Misplaced "+item.name)}
if (item.type === "cell" && this.isOpen) {
if (item.linebreak) {return FALSE}
TEX.Error("Misplaced "+item.name);
}
if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
if (!item.isNotStack) {return TRUE}
this.Push(item.data[0]); return FALSE;
@ -1493,7 +1496,7 @@
var n = this.GetBrackets(name).replace(/ /g,"");
if (n && !n.match(/^(((\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/))
{TEX.Error("Bracket argument to "+name+" must be a dimension")}
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name}));
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name, linebreak: TRUE}));
var top = this.stack.Top();
if (top.isa(STACKITEM.array)) {
if (n && top.arraydef.rowspacing) {
@ -1504,7 +1507,8 @@
top.arraydef.rowspacing = rows.join(' ');
}
} else {
// force line break
if (n) {this.Push(MML.mspace().With({depth:n}))}
this.Push(MML.mo().With({linebreak:MML.LINEBREAK.NEWLINE}));
}
},
emPerInch: 7.2,