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

Allow U+2AEB (⫫) as binary operator #39350

Closed
jonas-schulze opened this issue Jan 21, 2021 · 10 comments · Fixed by #39403
Closed

Allow U+2AEB (⫫) as binary operator #39350

jonas-schulze opened this issue Jan 21, 2021 · 10 comments · Fixed by #39403
Labels
parser Language parsing and surface syntax unicode Related to unicode characters and encodings

Comments

@jonas-schulze
Copy link
Contributor

I have a few questions, but as soon as they are done, I can do a PR:

  1. Which operator preference would be best? I lean towards prec-comparison.
  2. Which "tab completion" should it have? I like \indep.
  3. How do I implement this completion?
@jonas-schulze jonas-schulze added parser Language parsing and surface syntax unicode Related to unicode characters and encodings labels Jan 21, 2021
@JeffBezanson
Copy link
Member

This is category Sm so it seems like a good candidate. Also U+2AEA since they're a pair. How is this used? It's described as a "tack", so indeed that to me would indicate a relation, but I'm curious.

Character names go in REPL/src/latex_symbols.jl. Is there an existing latex name for this?

@jonas-schulze
Copy link
Contributor Author

I use it in probability theory to denote the independence of events or random variables. There doesn't seem to be a commonly used latex name for it (see here and here). I've seen:

  • \indep, \independent, or \CI from personal scripts, usually defined via \perp\!\!\!\perp
  • \upmodels from MnSymbol
  • \upvDash and \Vbar from fdsymbol

However, \upmodels from fdsymbols is a different glyph. It seems to be a rotated \models.

I would go for both \upvDash and \indep for as well as \downvDash for to be in line with the existing \vDash (longer double stroked line).

@mcabbott
Copy link
Contributor

mcabbott commented Jan 26, 2021

These would be nice to have.

Re names, I like ⫫ \indep, but ⫫ \upvDash and ⫪ \downvDash seem odd to me. ‖ \Vert being double \vert is the pattern followed by ⊩ \Vdash, and then ⊨ \vDash has the dash not the vertical doubled. But once rotated they seem a bit confusing, the vertical isn't.

The single-line versions of these are ⊤ \top and ⊥ \bot == \perp. There is some precedent for ⫪ \Top and ⫫ \Perp == \Bot (these work with txfonts which is widely used) and, googling around, perhaps also for \barV & \Vbar (not sure which packages) and \textupmodels & \textdownmodels (xetex, somehow?). One list: this gist, another: this PDF.

@jonas-schulze
Copy link
Contributor Author

I like \Top and \Bot as they complement one another. Though I'm not convinced of \Perp since \perp and \bot are different symbols in Julia:

julia> perp = '⟂'
'⟂': Unicode U+27C2 (category Sm: Symbol, math)

julia> bot = '⊥'
'⊥': Unicode U+22A5 (category Sm: Symbol, math)

I don't think \upmodels and \downmodels are a good fit for Julia either, since \models produces a glyph with a shorter double stroke compared to \vDash:

julia> models = '⊧'
'⊧': Unicode U+22A7 (category Sm: Symbol, math)

julia> vDash = '⊨'
'⊨': Unicode U+22A8 (category Sm: Symbol, math)

We could also add all of them for better discoverability:

  • : \downvDash, \Top
  • : \upvDash, \Bot, \indep

@mcabbott
Copy link
Contributor

Interesting that \perp \neq \bot here, :⟂ != :⊥ in Julia. In latex \perp is the operator while I think you need \mathrel{\bot} to get the same spacing. But here there is no such distinction. Should those be added to the list of unicode equivalences? They seem to be visually indistinguishable in all the fonts I tried.

Agree that \upmodels etc aren't desirable.

I can't see \downvDash being the first thing that pops into anyone's head, so would vote that those don't increase discoverability. (\downvdash appears to be an invention of the MnSymbol package, to give \mathrel{\top} a name?)

@jonas-schulze
Copy link
Contributor Author

What list of Unicode equivalences?

@mcabbott
Copy link
Contributor

mcabbott commented Jan 26, 2021

Demonstration is:

julia> mumu = ['µ', 'μ']
2-element Vector{Char}:
 'µ': Unicode U+00B5 (category Ll: Letter, lowercase)  # micro?
 'μ': Unicode U+03BC (category Ll: Letter, lowercase)  # \mu<tab>, or μ on keyboard

julia> Symbol(mumu[1]) == Symbol(mumu[2])
false

julia> eval(Meta.parse(":$(mumu[1]) == :$(mumu[2])"))
true

Maybe the link is https://docs.julialang.org/en/v1/stdlib/Unicode/#Unicode.normalize . Somehow I thought Julia maintained a list of these, but that might be wrong?

@StefanKarpinski
Copy link
Member

I believe the equivalences come from Unicode normalization which is done by utf8proc (which we also maintain).

@jonas-schulze
Copy link
Contributor Author

Interesting, I didn't know about that. I've created a separate issue over there, as it is beyond the scope of this issue.

@jonas-schulze
Copy link
Contributor Author

@JeffBezanson what do you think of *vDash as aliases? I am happy to be outvoted and update #39403, if that helps to get it merged faster. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax unicode Related to unicode characters and encodings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants