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

add support for unicode angle brackets, single vertical bar, double vertical bar #1123

Merged
merged 5 commits into from
Feb 1, 2018

Conversation

kevinbarabash
Copy link
Member

This PR also allows these symbols to be used with left/right delimiters. This should allow us to finally close #243.

TODO: write some tests

"<", ">", "\\langle", "\\rangle", "\\lt", "\\gt",
"\\lvert", "\\rvert", "\\lVert", "\\rVert",
"<", ">", "\\langle", "\u27e8", "\\rangle", "\u27e9", "\\lt", "\\gt",
"\\lvert", "\\rvert", "\u2223", "\\lVert", "\\rVert", "\u2225",
Copy link
Member

Choose a reason for hiding this comment

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

Just out of curiosity, is it valid to have right delimiters, e.g., \rangle, as a left delimiter?

Copy link
Member Author

Choose a reason for hiding this comment

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

I checked with quicklatex.com and it appears so although I'm not sure in what context you'd actually want to do that.

@ronkok
Copy link
Collaborator

ronkok commented Jan 31, 2018

PR #993 and unicode-math both map U+2223 to \mid, not to \lVert or \rVert. \mid is an operator, not a delimiter, useful for set builder notation.

The single character analogue to \vert is ASCII "|", U+007C. That's been true since the TeXbook, p146.

@kevinbarabash
Copy link
Member Author

PR #993 and unicode-math both map U+2223 to \mid, not to \lVert or \rVert. \mid is an operator, not a delimiter, useful for set builder notation.

@ronkok thanks for catching this. I'll remove the \lvert/\rvert changes from this diff.

@ronkok
Copy link
Collaborator

ronkok commented Jan 31, 2018

Similarly, unicode-math maps U+2225 to \parallel, which is also an operator, not a delimiter.

const cases = [
['\\left\\langle \\right\\rangle', '\\left< \\right>'],
['\\left\\langle \\right\\rangle', '\\left\u27e8 \\right\u27e9'],
];
Copy link
Member Author

@kevinbarabash kevinbarabash Feb 1, 2018

Choose a reason for hiding this comment

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

I think this could be extend to something like:

const cases = {
    'shouldParse': [ ... ],
    'shouldBuild': [ ... ],
    'shouldNotParse': [ ... ],
    'shouldNotBuild': [ ... ],
    'shouldParseLike': [ ... ],
    'shouldBuildLike': [ ... ],
};

I'll open a separate PR for this.

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.

Symbol unicode replacement doesn’t work
3 participants