Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds math commands, HTML rendering, and screenshotter tests. #291

Merged
merged 1 commit into from
Aug 20, 2015

Conversation

kevinbarabash
Copy link
Member

This is part 2 of 3. Part 1 added new fonts metrics. Part 3 will add MathML support and unit tests.

Depends on #290.

TODO:

  • add aliases for \frak, \bold, and \Bbb
  • test that fonts don't leak past the end of the group when nesting

@gagern
Copy link
Collaborator

gagern commented Jul 6, 2015

The commit message writes “Part 2 will add…” which should read “Part 3…”. The screenshot tests don't cover the question of the scope of the new commands, discussed in #132 (comment).

@kevinbarabash
Copy link
Member Author

I decided to leave out the commands defined using \DeclareOldFontCommand. I'd like to land the basic font commands first and tackle rm, etc. later.

@gagern
Copy link
Collaborator

gagern commented Jul 6, 2015

I think the scoping checks, or at least one scoping check, makes sense for \mathrm and friends as well. To check that they affect nested groups but the effect does not leak past the end of the group.

@kevinbarabash
Copy link
Member Author

To check that they affect nested groups but the effect does not leak past the end of the group.

I meant to do that and forgot. Thanks for reminding me.

var font = options.font;
if (font) {
if (font === "mathit" || utils.contains(["\u0131", "\u0237"], value)) {
return mathit(value, mode, color, classes.concat(["mathit"]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this add the "mathit" class twice sometimes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@gagern
Copy link
Collaborator

gagern commented Jul 9, 2015

The Lap example got incorrectly included in this commit, right? I'm really looking forward to getting that non-determinism dealt with automatically one day soon…

@@ -308,13 +361,72 @@ var spacingFunctions = {
}
};

var greekCapitals = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put this above all of the functions that use it?

@kevinbarabash kevinbarabash force-pushed the fonts-p2_rendering branch 3 times, most recently from 4f0c353 to c67fcd2 Compare July 9, 2015 05:10
@kevinbarabash
Copy link
Member Author

I'll have to wait until part 1 gets merged before I can tackle "test that fonts don't leak past the end of the group when nesting".

"\\Bbb": "\\mathbb",
"\\bold": "\\mathbf",
"\\frak": "\\mathfrak"
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these font aliases work in LaTeX?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested these and they do.

@xymostech
Copy link
Contributor

This looks good! I was a little confused about the spacing between the + and the \KaTeX, but it looks like we just forgot to add an "mord" class there. I'll go sneak that in...

@kevinbarabash
Copy link
Member Author

@xymostech let me know when you've sneaked it in and I'll rebase and redo the screenshots.

@kevinbarabash kevinbarabash mentioned this pull request Aug 5, 2015
@kevinbarabash kevinbarabash force-pushed the fonts-p2_rendering branch 2 times, most recently from 4dd3b2a to 67538d2 Compare August 8, 2015 04:06

return makeSpan(
["katex-logo"], [k, a, t, e, x], options.getColor());
["katex-logo", "mord"], [k, a, t, e, x], options.getColor());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snuck in the "mord"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevinbarabash
Copy link
Member Author

A couple of the screenshots are differently, although they don't look different when using github's onion skinning thingy. In particular these are LimitControls-firefox.png and UnsupportedCmds-firefox.png. They're probably suffering from the subpixel differences fixed in #324.

@kevinbarabash
Copy link
Member Author

@xymostech this is ready for review now.

@xymostech
Copy link
Contributor

This all looks good! Sorry it took me so long to review this!

@kevinbarabash
Copy link
Member Author

@xymostech no worries. Thank you. I'll rebase later today.

@gagern
Copy link
Collaborator

gagern commented Aug 19, 2015

I'm so happy that this is going forward now!

This is part 2 of 3.  Part 1 added new fonts metrics.  Part 2 will add MathML support and unit tests.
kevinbarabash added a commit that referenced this pull request Aug 20, 2015
Adds math commands, HTML rendering, and screenshotter tests.
@kevinbarabash kevinbarabash merged commit 2d9a6f3 into KaTeX:master Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants