Skip to content

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

Merged
k4b7 merged 1 commit intoKaTeX:masterfrom
edemaine:mathtools
Jun 30, 2017
Merged

Implement \coloneqq, \colonequals, etc. based on mathtools and colonequals#727
k4b7 merged 1 commit intoKaTeX:masterfrom
edemaine:mathtools

Conversation

@edemaine
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

@k4b7
Copy link
Copy Markdown
Member

k4b7 commented Jun 30, 2017

#751 has been merged.

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

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

@k4b7
Copy link
Copy Markdown
Member

k4b7 commented Jun 30, 2017

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.

@k4b7
Copy link
Copy Markdown
Member

k4b7 commented Jun 30, 2017

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.

@k4b7 k4b7 merged commit 0edd3d1 into KaTeX:master Jun 30, 2017
@edemaine
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

@ronkok Beautiful!!

@ronkok
Copy link
Copy Markdown
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.

@k4b7
Copy link
Copy Markdown
Member

k4b7 commented Jul 3, 2017

@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