Julia: The Greeks and Math operators at the command line via LaTeX
You know, hailing from a Theoretical Physics background, there isn’t much that surprises me these days.
If you learn about Black Holes, Quantum Mechanics, Parallel Universes and Time Travel Theories, what else in the world can faze you?
Well, this wonderful lady (language) by the name of Julia has indeed done it.
If you come from a STEM background, please sit up and pay attention.
As your peers the world over are basically seeing a renaissance in scientific computing.
The sheer amount of convenience, speed and time saved is phenomenal.
I am aware that I may well be preaching to the converted. Anybody who is somebody in the STEM world is probably already using Julia to some capacity, as indicated in the articles above.
However, the purpose of this article is to share the convenience of Julia with the non-STEM crowd.
As you shall see, the benefits are absolutely immense.
The Key Feature: LaTeX compatibility
While it is a mainstay of the academic and scientific world, it somehow has not caught on in the commercial realm.
Which is an absolute pity, given that it is open source.
The use of LaTeX came about as it was realised that the ubiquitous document preparation software, Microsoft Word, was inadequate when it came to scientific notation and symbols.
Instead of hunting through the tiny characters in Microsoft Word, it was far more convenient to type out the name of the symbol, and receive EXACTLY what you wanted.
And unlike Word, LaTeX does not drastically rearrange itself at the drop of a hat.
Hence it doesn’t take much to see why LaTeX provides a far more attractive alternative compared to MS Word.
Julia provides native LaTeX functionality
True to its raison d’etre as scientific programming language, Julia seeks to include provide these features, built in.
Which means that you are not required to import any external library.
It is available literally at the touch of a button
4 simple steps:
1. The backslash key: “ \ ”
2. Spell the character’s LaTeX command.
3. Press the “tab” key to complete the command.
4. Execute as intended
Demonstration in Julia code
- Backslash “ \ ”
2. Key in the command.
“sqrt” is LaTeX for square root.
3. Press the “tab” key to auto-complete
4. Execute as intended.
And you can apply this to countless characters and math expressions in the LaTeX library.
I’ve included some below for your reference.
The Greek Alphabets
Julia code and output \sigma -----> σ\alpha -----> α\beta -----> β\gamma -----> γ\zeta -----> ζ\phi -----> ϕ\psi -----> ψ\rho -----> ρ\theta -----> θ\xi -----> ξ
Math operators
#Julia code and output#\nabla -----------> ∇ #derivative\int -----------> ∫ #integral \oiint -----------> ∯ #multi-dimensional integral \ointclockwise -----------> ∲ #clockwise closed-loop integral \Pi -----------> Π #product operator\Sigma -----------> Σ #summantion operator
Relational operators
#Julia code and output#\nsubseteq -----------> ⊈ is not subset of\cong -----------> ≅ #congruent to \asymp -----------> ≍ #asymptotic to \approx -----------> ≈ #approximately equal to
Hope this article has been helpful!