Skip to content

Commit

Permalink
Fix bugs in \atop, \over \choose and add unit tests for them
Browse files Browse the repository at this point in the history
This commit:
- Add missing unit tests for \atop, \over \choose
- Fix case when they have fences around them (the command name was output instead of the right fence)
- Use linethickness="0px" instead of unitless "0". This closes #43
  • Loading branch information
fred-wang committed Mar 23, 2019
1 parent 104a5d1 commit b6ba788
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions TeXZilla.jison
Original file line number Diff line number Diff line change
Expand Up @@ -577,28 +577,28 @@ closedTerm
$$ = newTag("mrow", $1 + newMrow($2) + $3);
}
| "{" styledExpression TEXATOP styledExpression "}" {
$$ = newTag("mfrac", newMrow($2) + newMrow($4), "linethickness=\"0\"");
$$ = newTag("mfrac", newMrow($2) + newMrow($4), "linethickness=\"0px\"");
}
| left styledExpression TEXATOP styledExpression right {
$$ = newTag("mfrac", newMrow($2) + newMrow($4), "linethickness=\"0\"");
$$ = newTag("mrow", $1 + $$ + $3);
$$ = newTag("mfrac", newMrow($2) + newMrow($4), "linethickness=\"0px\"");
$$ = newTag("mrow", $1 + $$ + $5);
}
| "{" styledExpression TEXOVER styledExpression "}" {
$$ = newTag("mfrac", newMrow($2) + newMrow($4));
}
| left styledExpression TEXOVER styledExpression right {
$$ = newTag("mfrac", newMrow($2) + newMrow($4));
$$ = newTag("mrow", $1 + $$ + $3);
$$ = newTag("mrow", $1 + $$ + $5);
}
| "{" styledExpression TEXCHOOSE styledExpression "}" {
$$ = newTag("mfrac", newMrow($2) + newMrow($4),
"linethickness=\"0\"");
"linethickness=\"0px\"");
$$ = newTag("mrow", newMo("(") + $$ + newMo(")"));
}
| left styledExpression TEXCHOOSE styledExpression right {
$$ = newTag("mfrac", newMrow($2) + newMrow($4),
"linethickness=\"0px\"");
$$ = newTag("mrow", $1 + $$ + $3);
$$ = newTag("mrow", $1 + $$ + $5);
$$ = newTag("mrow", newMo("(") + $$ + newMo(")"));
}
| NUM { $$ = newTag("mn", $1); }
Expand Down
7 changes: 7 additions & 0 deletions unit-tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6ba788

Please sign in to comment.