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

Conversation

Projects
None yet
3 participants
@ice1000
Copy link
Contributor

commented Apr 23, 2019

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

Addressed my own comment: #1947 (comment)

Support double-square curly braces
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
@ice1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

Use this code to preview on your website:

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2019

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

@ice1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

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

Sure, done.

@ice1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

@ronkok CI passed, please take a look.

@ronkok

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2019

Yep.

ice1000 added some commits Apr 24, 2019

@ice1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Addressed comments, please retake a look

@ice1000

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2019

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

@ice1000

This comment has been minimized.

Copy link
Contributor Author

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

left a comment

Looks good to me.

@ronkok ronkok merged commit 6bb312f into KaTeX:master Apr 25, 2019

9 of 10 checks passed

Pages changed All files already uploaded
Details
Header rules 2 header rules processed
Details
Mixed content No mixed content detected
Details
Redirect rules 5 redirect rules processed
Details
Screenshotter - Chrome Screenshotter Passed
Details
Screenshotter - Firefox Screenshotter Passed
Details
ci/circleci: chrome Your tests passed on CircleCI!
Details
ci/circleci: firefox Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
@ronkok

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2019

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

@ice1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 25, 2019

You're welcome!

ben-dyer added a commit to ben-dyer/KaTeX that referenced this pull request May 3, 2019

ben-dyer added a commit to ben-dyer/KaTeX that referenced this pull request May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.