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

Mathematical operators and symbols support #49

Open
k0001 opened this issue Feb 4, 2013 · 26 comments
Open

Mathematical operators and symbols support #49

k0001 opened this issue Feb 4, 2013 · 26 comments

Comments

@k0001
Copy link

k0001 commented Feb 4, 2013

Modern markup languages such as MathML, or programming languages such as Agda, Haskell and Scala can make extensive use of the Greek alphabet and mathematical symbols. Users of these languages could benefit from Source Code Pro if these characters were supported. In particular Agda and MathML make the most extensive use of Unicode, by design.

Issue #48 already requests Greek alphabet support.

Here are some quite comprehensive list of mathematical symbols:

Here are some code snippets and blog posts making use of this feature:

@k0001
Copy link
Author

k0001 commented Feb 4, 2013

I'd like to add that fonts such as DejaVu Sans Mono or FreeMono already support a wide variety of such mathematical symbols, operators, and letters.

@pauldhunt
Copy link
Contributor

I am planning on adding Greek at some point, but I had no plans to add these. I would definitely need some help creating all of these.

@k0001
Copy link
Author

k0001 commented Feb 5, 2013

Greek support will be excellent.

Certainly, this is hard work. In any case, maybe it can be helpful to start by prioritizing some of these symbols according to how often they are used, so I'll try that:

In this list http://archive.tlt.psu.edu/suggestions/international/bylanguage/mathchart.html#set I've often came across symbols in these categories:

  • Letter Symbols
  • Logic & Set Theory
  • Common Statistics
  • Common Symbols
  • Calculus
  • Geometric Symbols (Tacks)
  • Logical Proofs
  • Common Equivalence Operators
  • Other mathematical symbols (∓ ∗ ∘ ∙ ∶ ∷ ≔ ≟ ≺ ≻ ⊓ ⊔ ⊕ ⊖ ⊗ ⊙ ⊛ ⊝ ⋅)

@pauldhunt
Copy link
Contributor

Can you give Unicode ranges/code points for these?

@k0001
Copy link
Author

k0001 commented Feb 5, 2013

Yes. Thanks for asking that.

It seems that the most common mathematical symbols are, unsurprisingly,
in the Mathematical Operators block: U+2200–U+22FF.

There are some letter-like symbols, however, that fall outside that
block:

  • ℵ → U+2135
  • ℘ → U+2118
  • ℑ → U+2111
  • ℜ → U+211C
  • ℝ → U+211D
  • ℂ → U+2102
  • ℕ → U+2115
  • ℙ → U+2119
  • ℚ → U+211A
  • ℤ → U+2124

@jfim
Copy link

jfim commented Jan 2, 2014

Specifically for the Scala programming language, the rightwards double arrow (U+21D2 ⇒) is part of the language specification, so it would be awesome to have it. The leftwards single arrow (U+2190 ←) is already in the font and looks great!

@pauldhunt
Copy link
Contributor

@jfim that’s easy, i’ll sneak that in there.

@jfim
Copy link

jfim commented Jan 6, 2014

Sweet, can't wait to get rid of the horrid fallback font arrows! :)

@andy-morris
Copy link

@pauldhunt Hooray! Mono fonts always seem to have ←/→ but never ⇐/⇒. (Haskell uses ⇒ with the UnicodeSyntax option as well, fwiw.) So a font that actually has them would be a nice change. :)

@adrientetar
Copy link

The Hasklig font has some arrows that could be checked-in upstream.

@miguelsousa
Copy link
Member

The Powerline glyphs may be a good addition since there's an open request (#43). The other glyphs not so much because the set of arrows is very incomplete.

@valpackett
Copy link

Any progress on this? (Especially ∷ ⇒ →)

@pauldhunt
Copy link
Contributor

I am actively working on the next revision of the SCP fonts and plan to add these characters. the single arrow is already in the font, so you’re jus looking for the double stroked arrow and the proportion symbol (u+2237)? is that correct?

@andy-morris
Copy link

If you wouldn't mind adding ∀ and ∃ too, that'd be even better. But at least a mono font with a non-ugly ⇒ would be great.

(btw: Hasklig doesn't play nice with GUI vims because it lays out the characters on a grid.)

@pauldhunt
Copy link
Contributor

I’ve gone and added u+21D2, u+2200, u+2203, u+2237 to the design masters and these will make it into the next version of the released upright fonts.

@deepankarpathak
Copy link

Is there is any way to add Greek symbols like λ (lambda), θ (theta), σ (Sigma) and ι(iota). This would be of great help.

@yurikhan
Copy link

yurikhan commented Jun 5, 2015

@deepankarpathak You might want to watch #94.

@pauldhunt
Copy link
Contributor

pauldhunt commented Jun 5, 2015 via email

@musm
Copy link

musm commented Aug 24, 2015

+1 I use the julia repl and I cannot see certain symbols since they are not available to source code pro. Would love to use source code pro but certain math symbols are simply not there.
E.g. compare (right, dejavu sans mono, left source code pro)

symbols compare

@pauldhunt
Copy link
Contributor

@mmoh please list the Unicode values or enumerate the characters here for the missing characters so that I can get this into an upcoming release.

@andy-morris
Copy link

The missing characters in the screenshot are:

  • ∈ (U+2208)
  • ∉ (U+2209)
  • ∋ (U+220B)
  • ∌ (U+220C)
  • ∛ (U+221B)
  • ≢ (U+2262)
  • ⊆ (U+2286)
  • ⊈ (U+2288)
  • ⊊ (U+228A)

If you do add these, may I request also ⊂ (U+2282) and the superset signs (U+2283,5,7,9)?

@musm
Copy link

musm commented Aug 24, 2015

Thanks @andy-morris here is also a larger list that would be useful to include:
http://julia.readthedocs.org/en/latest/manual/unicode-input/

@loskutov
Copy link

loskutov commented Apr 21, 2016

Are there any plans to add some more math symbols? The number of the most used ones is not that big:

  • ∈/∉ (U+2208 and U+2209)
  • ∘ (U+2218)
  • ∧/∨ (U+2227 and U+2228)
  • ∩/∪ (U+2229 and U+222A) — for some reason the former is already supported while the latter is not
  • ⊢/⊨ (U+22A2 and U+22A8)
  • ⊤/⊥(U+22A4 and U+22A5)
  • ↵ (U+21B5) is used by some editors to point the end of line

Most of these symbols also seem to be pretty easy to draw.

@pauldhunt
Copy link
Contributor

pauldhunt commented Apr 21, 2016

I am open to adding more mathematical symbols, but this is low on my priority list unless given some compelling reason to include them particular symbols. Because of the sheer number of symbols that are used in mathematics, it would be instructive to understand how useful particular definite sets would be. For example, the addition of u+2229 came about when I wanted to add support for a historical standard font scheme, the Windows Glyph List 4. Having clearly delimited sets like this with a clear intended purpose makes it easier to prioritize the addition of more mathematical symbols that otherwise seem very arbitrary.

@loskutov
Copy link

loskutov commented Apr 21, 2016

These symbols are used in base-unicode-symbols Haskell package as well as in ScalaZ, a popular library for the Scala programming language, so their addition would make it much less painful to view and edit the code written in these languages. (As was previously stated, Agda makes even more extensive use of Unicode, so these symbols are used in it as well)

The following symbols provided by the UnicodeSyntax Haskell extension are lacking:

Character Code point Unicode name
U+2605 BLACK STAR
U+2919 LEFTWARDS ARROW-TAIL
U+291A RIGHTWARDS ARROW-TAIL
U+291B LEFTWARDS DOUBLE ARROW-TAIL
U+291C RIGHTWARDS DOUBLE ARROW-TAIL

The following symbols used in Prelude.Unicode Haskell module are lacking:

Character Code point Unicode name
U+2124 DOUBLE-STRUCK CAPITAL Z
U+211A DOUBLE-STRUCK CAPITAL Q
U+2208 ELEMENT OF
U+2209 NOT AN ELEMENT OF
U+2218 RING OPERATOR
U+2227 LOGICAL AND
U+2228 LOGICAL OR
U+2260 NOT EQUAL TO
U+2261 IDENTICAL TO
U+2262 NOT IDENTICAL TO
U+226E NOT LESS-THAN
U+226F NOT GREATER-THAN
U+22A5 UP TACK
U+22C5 DOT OPERATOR
U+29FA DOUBLE PLUS

The following symbols used in other modules of the same package are lacking:

Character Code point Unicode name
U+2042 ASTERISM
U+2205 EMPTY SET
U+2206 INCREMENT
U+220B CONTAINS AS MEMBER
U+220C DOES NOT CONTAIN AS MEMBER
U+2216 SET MINUS
U+222A UNION
U+226A MUCH LESS-THAN
U+226B MUCH GREATER-THAN
U+2295 CIRCLED PLUS
U+229B CIRCLED ASTERISK OPERATOR
U+22D8 VERY MUCH LESS-THAN
U+22D9 VERY MUCH GREATER-THAN
U+29FB TRIPLE PLUS
U+2AF4 TRIPLE VERTICAL BAR BINARY RELATION

Also, many of these characters are required for APL (issue #114).

@marckassay
Copy link

The ≡ (U+2261) character from one of @loskutov's lists is needed by posh-git. Although this is in the 2.030R-ro/1.050R-it release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests