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

Support Unicode colon equals #1151

Merged
merged 2 commits into from
Feb 9, 2018
Merged

Support Unicode colon equals #1151

merged 2 commits into from
Feb 9, 2018

Conversation

ronkok
Copy link
Collaborator

@ronkok ronkok commented Feb 9, 2018

This PR adds support for three Unicode characters:

This PR adds support for three Unicode characters: `≔` `≕` `⩴`
@codecov
Copy link

codecov bot commented Feb 9, 2018

Codecov Report

Merging #1151 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1151      +/-   ##
==========================================
+ Coverage   78.95%   79.01%   +0.06%     
==========================================
  Files          59       59              
  Lines        3872     3875       +3     
  Branches      655      655              
==========================================
+ Hits         3057     3062       +5     
+ Misses        674      672       -2     
  Partials      141      141
Impacted Files Coverage Δ
src/macros.js 82.6% <100%> (+0.38%) ⬆️
src/functions.js 87.03% <0%> (+3.7%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 383a68b...78c9ae0. Read the comment docs.

@ronkok
Copy link
Collaborator Author

ronkok commented Feb 9, 2018

I withheld these characters from PR #933 because three packages address these characters and they all disagree on the alias.

Character Code Point mathtools and KaTeX colonequals and KaTeX unicode-math
U+2254 \coloneqq \colonequals \coloneq
U+2255 \eqqcolon \equalscolon \eqcolon
U+2A74 \Coloneqq \equalscoloncolon \Coloneq

Not only that, but the Unicode math aliases are used by mathtools to render a different character.

Alias unicode-math mathtools and KaTeX
\coloneq :−
\eqcolon −:
\Coloneq ::−

I have said in earlier PRs that for Unicode support, the internal alias is only a means, not an end. What matters is that the author must get the results desired from the input of a specific Unicode character. That is still true, so I have implemented these Unicode characters by writing macros that call the mathtools aliases.

It’s a good thing that those internal aliases don’t really matter. This could have been ugly.

@ronkok
Copy link
Collaborator Author

ronkok commented Feb 9, 2018

Visual confirmation:
colonequals

Copy link
Member

@edemaine edemaine left a comment

Choose a reason for hiding this comment

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

Great work as usual!

@edemaine edemaine merged commit d80be86 into KaTeX:master Feb 9, 2018
@ronkok ronkok deleted the colonequals branch February 20, 2018 18:55
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