-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Inconsistent unicode/LaTeX symbol commands #21646
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
Comments
There is another thread about this somewhere. Perhaps discourse or the old mailing lists. There are some defacto standards eg: https://github.com/wspr/unicode-math And the standard for unicode names for math symbols: https://www.w3.org/2003/entities/2007xml/MathMap-9.txt |
I see, so Julia uses wspr/unicode-math? But these shortcuts are not standard, and unfortunately inconsistent as I showed. I don't know why |
The latex_symbols list (added in #6911 and subsequently extended) was mainly based on the W3C mapping and the unicode-math LaTeX package. In particular, the The basic issue is that I wanted to avoid the can of worms of defining our own custom abbreviations, as opposed to adopting something relatively widespread like the I chose not to support tab-completion of LaTeX functions like |
I'm not opposed to defining additional (shorter) abbreviations. (The |
Thanks for the background! Because of https://xkcd.com/927 I think standard LaTeX commands, e.g. My reasons for wanting to clean up the Julia repository of unicode-latex mappings were to use these mappings for other things. Since I realize that perhaps not everyone agrees with my choices, I created this: https://github.com/ViktorQvarfordt/unicode-latex. A mapping between unicode symbols and (standard) LaTeX commands. Furthermore, in that repo I also created a LaTeX package from this that allows |
Though I assume participants of this thread are aware of this, it is perhaps worth noting for other readers that customizing unicode completions is fairly easy and probably the best way to pick and choose from the numerous TeX package notations. # add this to ~/.juliarc.jl
let latex_symbols = Base.REPLCompletions.latex_symbols
# Choose a more math-like name for unicode representations
latex_symbols["\\Reals"] = latex_symbols["\\BbbR"]
latex_symbols["\\Naturals"] = latex_symbols["\\BbbN"]
latex_symbols["\\Integers"] = latex_symbols["\\BbbZ"]
latex_symbols["\\Rationals"] = latex_symbols["\\BbbQ"]
latex_symbols["\\Complexes"] = latex_symbols["\\BbbC"]
# or even shorter
latex_symbols["\\R"] = latex_symbols["\\BbbR"]
latex_symbols["\\N"] = latex_symbols["\\BbbN"]
latex_symbols["\\Z"] = latex_symbols["\\BbbZ"]
latex_symbols["\\Q"] = latex_symbols["\\BbbQ"]
latex_symbols["\\C"] = latex_symbols["\\BbbC"]
end This will give you exactly what you personally prefer, no compromise required. It should also instantaneously work in Jupyter and Juno, if I'm not mistaken. You might then consider adding same abbreviations to some default Didn't find it being mentioned in the manual, though. |
Would still be nice to simplify/rationalize the tab completions for different font variations if we can agree on something, since the current abbreviations are pretty unwieldy and counter-intuitive. I would tend to prefer something like |
In any case, |
Unfortunately, One option would be to terminate all font choices with |
Closed by #25980. |
\mbfA
for 𝐀 and\mscrA
for 𝒜 and\mfrakA
for 𝔄 but\BbbA
for 𝔸Double-struck got messed up:
\Bbb
(BlackBordBold) instead of\mbbA
. This is the issue.Taking it further: Ideally we would like to use the LaTeX commands, such as
\mathbf{A}
, but I guess it was decided that's too long (and I agree) so it's shortened to\mbfA
. If the argument to deviate from LaTeX is to make it shorter, then i'd suggest to also remove them
. However, I'd like to raise the discussion of instead (or in addition) using shortenings of the unicode names, such as\bA
for 𝐀, since its unicode name isMATHEMATICAL BOLD CAPITAL A
, as seen in https://www.w3.org/TR/xml-entity-names/bold.html. Thus we have\bA
for 𝐀 (bold)\sA
for 𝒜 (script)\fA
for 𝔄 (frak)\dA
for 𝔸 (double-struck)\iA
for 𝐴 (italic)\ssA
for 𝖠 (sans-serif)\ssbiA
for 𝘼 (MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A).It is debatable which of
\sA
and\ssA
should be is 𝖠 (sans-serif). If script gets demoted it can be\scA
for 𝒜 (script).I suggest allowing short and sweet unicode shortenings (as explained) and full LaTeX style commands (perhaps without the braces, i.e.
\mathbfA
instead of\mathbf{A}
).(You might wonder "Why do I care?". I use unicode inputs in other places, and there is no de-facto standard repository for unicode <-> latex etc. The mindset is scientific writing, this repo is like-minded and is popular, I'm okay with setting the standards in here. Otherwise, point me in the right direction, then also this project should track this de-facto repository of unicode mappings.)
The file in question is latex_symbols.jl.
The text was updated successfully, but these errors were encountered: