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 double-square curly braces #1953

Merged
merged 9 commits into from Apr 25, 2019
Merged

Support double-square curly braces #1953

merged 9 commits into from Apr 25, 2019

Conversation

@ice1000
Copy link
Contributor

@ice1000 ice1000 commented Apr 23, 2019

Signed-off-by: ice1000 ice1000kotlin@foxmail.com

Addressed my own comment: #1947 (comment)

Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 23, 2019

Use this code to preview on your website:

\mathopen{\{\mkern-3.2mu[}
i
\mathclose{]\mkern-3.2mu\}}

@codecov-io
Copy link

@codecov-io codecov-io commented Apr 23, 2019

Codecov Report

Merging #1953 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1953      +/-   ##
==========================================
+ Coverage   94.91%   94.92%   +<.01%     
==========================================
  Files          79       79              
  Lines        4839     4843       +4     
  Branches      845      845              
==========================================
+ Hits         4593     4597       +4     
  Misses        222      222              
  Partials       24       24
Flag Coverage Δ
#screenshotter 89.48% <100%> (ø) ⬆️
#test 86.02% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
src/macros.js 97.62% <100%> (+0.02%) ⬆️

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 2d06609...8af19e2. Read the comment docs.

@ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 24, 2019

@ice1000 Can you go in and resolve the merge conflicts?

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 24, 2019

@ice1000 Can you go in and resolve the merge conflicts?

Sure, done.

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 24, 2019

@ronkok CI passed, please take a look.

@ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 24, 2019

@ice1000 Three comments:

  1. I can find no LaTeX packages with a function named \llbrace or \rrbrace. But the stix package contains \lBrace and \rBrace. Those would be better choices for the names of these functions.

  2. KaTeX produces both HTML and MathML and getting a macro to do each one well gets a little tricky. @edemaine has written a KaTeX-only macro syntax that enables good HTML and good MathML in the same macro. The syntax is your case would be defineMacro("\\lBrace", \\html@mathml{<HTML code>}{<MathML code>}); You have already written good HTML code. But in MathML you can't be sure what font will be used, so you have to call the Unicode character. And it helps to use the \char function so that the macro does not expand in an infinite loop. So it ends up as: defineMacro("\\lBrace", \\html@mathml{"\\mathopen{\\{\\mkern-3.2mu[}}{"\\mathopen{\\char`\u2983});

  3. Do you want to try writing macros for characters and that expand to \lBrace and \rBrace?

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 24, 2019

I can find no LaTeX packages with a function named \llbrace or \rrbrace. But the stix package contains \lBrace and \rBrace.

Well yeah, I've done the same investigation and got the same results prior to PRing kAtEx. My motivation of using \llbrace is that it's more consistent with another function, \llbracket.
I'll change it to \lBrace.

KaTeX produces both HTM ...

Got it! Will do.

Do you want to try writing...

Yeah! Is that simply aliasing the macro?

@ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 24, 2019

Yep.

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 24, 2019

Addressed comments, please retake a look

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 25, 2019

I've observed that PRs in this repo are all squashed when merging so I assumed that it's Ok of merge master/creating small commits instead of rebasing on master and always commit by amending the previous one.

@ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 25, 2019

@ice1000 Can you also add to the documentation in docs/support_table.md?

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 25, 2019

@ice1000 Can you also add to the documentation in docs/support_table.md?

Done

ronkok
ronkok approved these changes Apr 25, 2019
Copy link
Collaborator

@ronkok ronkok left a comment

Looks good to me.

@ronkok ronkok merged commit 6bb312f into KaTeX:master Apr 25, 2019
10 checks passed
@ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 25, 2019

@ice1000 Thank you for this PR. It's a nice addition to KaTeX.

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Apr 25, 2019

You're welcome!

@ylemkimon
Copy link
Member

@ylemkimon ylemkimon commented Oct 21, 2019

[clabot:check]

@khanbot
Copy link

@khanbot khanbot commented Oct 21, 2019

Hey @ice1000,

Thanks for the PR! Mind signing our Contributor License Agreement?

When you've done so, go ahead and comment [clabot:check] and I'll check again.

Yours truly,
khanbot


Added by @ylemkimon:

Sorry for the late notice. Our CLA bot was offline for a while.

Please acknowledge that the terms of the Agreement applies to any Contributions submitted before signing the Agreement, including but not limited to this PR. If you do not wish to sign such a CLA, let us know so that we can find a way to revert any contributions you may have made.

Disclaimer: I'm neither an employee nor an agent of Khan Academy.

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Oct 21, 2019

[clabot:check]

@khanbot
Copy link

@khanbot khanbot commented Oct 21, 2019

CLA signature looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants