Ueauty
The Julia language is unique in that the base language provides unicode aliases for a number of commonly used symbols, the default language REPL has built-in LaTeX to unicode conversion, and it is arguably the only programming language where use of unicode symbols is common even in purely English language programs. Additionally, nearly all Julia editor plug-ins contain some form of LaTeX to unicode conversion.
Unfortunately, while the provided aliases are extremely useful, there are quite a few missed opportunities as well.
This package is meant to provide additional aliases for universally recognized symbols as simply as possible, with 0 dependencies.
While many monospace fonts have good unicode support for all Greek letters as well as some of the more common mathematical symbols, the JuliaMono font has been designed specifically with readable, consistent unicode in mind. In particular alternate type faces such as \mathcal
(๐, โฌ, ๐, ๐
), \mathfrak
(๐, ๐
, ๐ต, ๐ถ
), \mathbb
(โ, โค, โ
), annotations eโ, yฬ, xฬ
, as well as some operations such as โ, โ
are much more consistent, readable and useable than in most other monospace fonts. I recommend you at least try it out.
Zero Dependencies
This package comes with a guarantee that no version of it will have any external dependencies except possibly in the Julia stdlib. This is to ameliorate any possible concerns about package bloat, and to make its use as close to the base language as possible
Safe, Universally Recognized Definitions
This package only defines symbols which are universally recognized (of course, your mileage may vary) and unlikely to be used in existing code (at least with any meaning other than used here).
For example, this package does NOT define const ฯต = eps
(likewise it does NOT define ฮต
) both because those are expected to be commonly used as variable names in code, and because they are not universally recognized as floating point $\epsilon$.
Macros
Unicode aliases are provided by the following macros, all of which are exported from the package.
Aliases can be declared by category, or all available can be defined with
Ueauty.@ueauty
โ Macro@ueauty
Declare all unicode aliases defined in Ueauty. See documentation for an explicit list.
Types
Ueauty.@ueauty_types
โ Macro@ueauty_types
Declare nice unicode aliases for Julia types. See documentation for an explicit list.
This macro provides the following symbols.
Symbol | LaTeX-to-Unicode | Defined as | Description |
---|---|---|---|
โ | \bbR | Real | Real number abstract type. |
โ | \bbC | Complex | Complex number abstract type. |
โค | \bbZ | Integer | Integral number abstract type. |
โ | \bbQ | Rational | Rational number abstract type. |
Constants
Ueauty.@ueauty_constants
โ Macro@ueauty_constants
Declare nice unicode aliases for some special constant values. See documentation for an explicit list.
This macro provides the following symbols.
Symbol | LaTeX-to-Unicode | Defined as | Description |
---|---|---|---|
๐พ | \scri | im | The imaginary unit. |
โ | \infty | Inf | Floating point infinity. |
โ
| \emptyset | Set{T}() | An empty set of type T , for example โ
(Float64) == Set(Float64[]) . |
Ueauty.โ
โ Functionโ
(T=Any)
Return an empty set with elements of type T
.
Operators
Ueauty.@ueauty_operators
โ Macro@ueauty_operators
Declare nice unicode aliases for some common operators. See documentation for an explicit list.
This macro provides the following symbols.
Symbol | LaTeX-to-Unicode | Defined as | Description |
---|---|---|---|
โ | \sum | sum | Summation operation. |
โ | \prod | prod | Product operation. |
โ | \Rightarrow | => | The Pair operator. |
โท | \triangleright | |> | The "pipe" operator. |
The โ
and โ
characters are NOT the same as ฮฃ
and ฮ
, so the symbols ฮฃ
and ฮ
are still available for regular use. With a good enough unicode font the distinction should be clear.