-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
rationalize some of the latex-ish tab completions #25980
Conversation
@@ -956,7 +960,6 @@ const latex_symbols = Dict( | |||
"\\ocommatopright" => "̕", # combining comma above right | |||
"\\droang" => "̚", # left angle above (non-spacing) | |||
"\\wideutilde" => "̰", # under tilde accent (multiple characters and non-spacing) | |||
"\\underbar" => "̱", # combining macron below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the other \underbar
are actually different characters (different widths). Is there a way to keep both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could the "combining macron below" (the shorter underbar) a different name.
But no one seems to have needed the shorter one up to now (since it was overwritten by the other \underbar
definition), and I couldn't come up with a great name, so to stay on the conservative side I just left it out.
"\\neg" => "¬", | ||
"\\circledR" => "®", | ||
"\\textasciimacron" => "¯", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a replacement for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. But it wasn't clear to me that we needed this — this is the non-combining macron. Who needs this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the APL high minus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it back, you are right: APL uses this for the "high minus", apparently. I'll can add it back in as \highminus
for the benefit of APL programmers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it's used in APL.jl, so perhaps worth keeping around, if only for that 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it back as \highminus
.
stdlib/REPL/src/latex_symbols.jl
Outdated
"\\degree" => "°", | ||
"\\pm" => "±", | ||
"\\textasciiacute" => "´", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here --- \acute
is a combining character but this one isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above — not clear why we need tab-completion for the non-combining ´
, and similarly for other non-combining Latin1 accents.
Nice! |
stdlib/REPL/src/latex_symbols.jl
Outdated
"\\onequarter" => "¼", | ||
"\\onehalf" => "½", | ||
"\\threequarters" => "¾", | ||
"\\questiondown" => "¿", | ||
"\\AA" => "Å", | ||
"\\AE" => "Æ", | ||
"\\DH" => "Ð", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be named "Eth" (or "ETH") for consistency with "\\eth" => "ð"
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'd also add a comment, as was done for \ltphi
below, to distinguish from \DJ
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like ð should instead be called \dh
below to be consistent with latex. The \eth
name comes from the AMS math symbols list, though. So maybe we should just have both \dh
and \eth
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added \dh
as a synonym for \eth
.
"\\textthreequarters" => "¾", | ||
"\\textquestiondown" => "¿", | ||
"\\ordmasculine" => "º", | ||
"\\questiondown" => "¿", | ||
"\\AA" => "Å", | ||
"\\AE" => "Æ", | ||
"\\DH" => "Ð", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to add \\ETH
here, for consistency with the lower case versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LaTeX only has \dh
, \DH
, and (in AMS math) \eth
.
Only the lower-case eth seems to be commonly used in mathematics, which is probably why AMS has only lower case.
People who are coding in Icelandic probably know the \DH
and \dh
LaTeX abbreviations (or rather, probably have their own keyboard layout).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, just making sure it wasn't an overlook. Thanks for the details.
This PR goes through the LaTeX tab completions and fixes some inconsistencies and nonsensical choices:
As discussed in Inconsistent unicode/LaTeX symbol commands #21646, since our abbreviations for bold, italic, etcetera are not really standard anyway, and the "standard" thing of
\mathbf{A}
etcetera is too unwieldy to be practical, this PR shortens the "font" abbreviations to what I think are sensible but still-recognizable choices. e.g.\bfA
for bold A,\itA
for italic A,\bbA
for blackboard A,\frakA
for fraktur A,\scrA
for script A,\sansA
for sans-serif A, and\ttA
for monospaced ("typewriter") A, with various combinations. I initially wanted to go for even shorter abbreviations, but I ran into lots of conflicts with other completions.I removed the
\Elz
prefix from all of the "Elsevier" LaTeX symbols, since I think it makes no sense for us to keep this, and similarly for\AMS
.I also removed the
\text
and\textascii
prefixes. In our context, there is no distinction between "text" and "math" mode, and the "ascii" things were actually Latin-1.Renamed
\textonehalf
etc. to\1/2
, since we are not limited to valid LaTeX identifiers. Added the other fraction shortcuts (swiped from allow identifiers to start with category No (Number, other) #20278).Finally, there were some duplicate or conflicting entries that I resolved (either by renaming or in some cases simply deleting completions that are unlikely to be used).