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

Implement \coloneqq, \colonequals, etc. based on mathtools and colonequals #727

Merged
merged 1 commit into from
Jun 30, 2017

Conversation

edemaine
Copy link
Member

I implemented the following commands from mathtools.sty, using macros with exactly their definitions in mathtools.sty:

\begin{matrix}
x\vcentcolon x \dblcolon x \coloneqq x \coloneq x \Coloneqq x \Coloneq x \\
x \eqqcolon x \Eqqcolon x \eqcolon x \Eqcolon x \\
x \colonapprox x \colonsim x \Colonapprox x \Colonsim x
\end{matrix}

coloneqq

I also implemented the following commands from colonequals.sty, as aliases to the mathtools.sty definitions, and adding a couple analogous definitions when the corresponding symbol wasn't already in mathtools.sty:

\begin{matrix}
x\ratio x \coloncolon x \colonequals x \coloncolonequals x \equalscolon x \equalscoloncolon x \\
x \colonminus x \coloncolonminus x \minuscolon x \minuscoloncolon x \\
x \colonapprox x \colonsim x \coloncolonapprox x \coloncolonsim x \\
x \simcolon x \simcoloncolon x \approxcolon x \approxcoloncolon x
\end{matrix}

colonequals

The colon will get more centered once we fix #726, or via manual tweaking via \raisebox (#685). But that is independent of this PR, which at least makes the commands available now, as suggested in #657.

@edemaine
Copy link
Member Author

This should wait for #751 so I can remove the braces.

@kevinbarabash
Copy link
Member

#751 has been merged.

@edemaine edemaine removed the blocked label Jun 30, 2017
@edemaine
Copy link
Member Author

Rebased and removed braces. This should be good to go, unless we want to add tests.

@kevinbarabash
Copy link
Member

I think this is okay to merge without screenshot tests. There are already a lot of commands which don't have screenshots. CONTRIBUTING.md provides this guideline:

If you add a feature that is dependent on the final output looking the way you created it, add a screenshot test.

The word "feature" is a little ambiguous. It would nice if we had a more explicit guidelines in this area. I think symbols by themselves probably aren't worth having a screenshot test. Commands that affect which glyphs are display such as font commands could probably be tested by snapshot tests and probably don't need screenshots. Same with handling unicode.

Things that do require screenshots are features that implement a specific layout, e.g. array, *matrix, stackrel, mathop, *lap, frac, not, etc.

If someone finds an issue with any of these commands then either the macro is incorrect or one of the commands in the macro isn't behaving correctly and should be fixed. When it's fixed, we should improve the screenshot test for that command.

@kevinbarabash
Copy link
Member

We could also add a lot of unit tests to katex-spec.js, but I'd rather be more targeted in our testing and focus on filling in some of the hole in our test coverage.

@kevinbarabash kevinbarabash merged commit 0edd3d1 into KaTeX:master Jun 30, 2017
@edemaine
Copy link
Member Author

I guess we need to add these to function support. How does this work? @ronkok do you have time to do this, or would you rather delegate?

@ronkok
Copy link
Collaborator

ronkok commented Jun 30, 2017

I already have that page ready and I plan to make a PR as soon as release 0.8.0 lands. For a advance look, I've put a temporary copy here.

Let me know if you see that I've missed anything or if you notice some major problem with organization.

@edemaine
Copy link
Member Author

@ronkok Beautiful!!

@ronkok
Copy link
Collaborator

ronkok commented Jun 30, 2017

@kevinbarabash, regarding all the new colonequals functions, a substitute for screenshots is to review them on the function support page, which has a temporary copy here.

@kevinbarabash
Copy link
Member

@ronkok LGTM. We'll probably want to update the function support page after we do a release.

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.

\mathop{x} should center single-character x
3 participants