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

rationalize some of the latex-ish tab completions #25980

Merged
merged 8 commits into from
Feb 14, 2018

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented Feb 9, 2018

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).

@stevengj stevengj added the REPL Julia's REPL (Read Eval Print Loop) label Feb 9, 2018
@@ -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
Copy link
Member

@JeffBezanson JeffBezanson Feb 9, 2018

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?

Copy link
Member Author

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" => "¯",
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ararslan, no, that would be u+207b, which we can already tab-complete via \^-.

A macron is not really intended to be used as a mathematical operator.

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 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.

Copy link
Member

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 😉

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 added it back as \highminus.

"\\degree" => "°",
"\\pm" => "±",
"\\textasciiacute" => "´",
Copy link
Member

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.

Copy link
Member Author

@stevengj stevengj Feb 9, 2018

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.

@JeffBezanson
Copy link
Member

Nice! \texttrademark always annoyed me... :)

"\\onequarter" => "¼",
"\\onehalf" => "½",
"\\threequarters" => "¾",
"\\questiondown" => "¿",
"\\AA" => "Å",
"\\AE" => "Æ",
"\\DH" => "Ð",
Copy link
Contributor

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?

Copy link
Contributor

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)

Copy link
Member Author

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.

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 added \dh as a synonym for \eth.

"\\textthreequarters" => "¾",
"\\textquestiondown" => "¿",
"\\ordmasculine" => "º",
"\\questiondown" => "¿",
"\\AA" => "Å",
"\\AE" => "Æ",
"\\DH" => "Ð",
Copy link
Contributor

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?

Copy link
Member Author

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).

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants