Skip to content

randolf-scholz/autokey_julia_unicode

Repository files navigation

AutoKey Unicode characters

Usage | Installation | Changelog | Features | Known Issues | References

demo

Usage

This script adds all the Unicode character abbreviations supported by Julia to AutoKey. However, instead of [TAB], they are triggered on [SPACE]. If you do not want to perform the replacement, simply hit [BACKSPACE] afterwards.

Installation

  1. Install AutoKey. Only works on X11, no Wayland support.
  2. Execute install.py (requires python ≥3.10)
  3. Restart AutoKey

Features

For overview see Supported Alphabets

Advantages of Unicode

  1. Work even when MathJax / LaTeX is not available (e.g. E-mails, chat clients, etc.)
  2. Is character efficient (e.g. when writing comments on https://math.stackexchange.com)
  3. Increases readability of source code.
  4. Copy-paste persistent.

Compatibility with MathJax & LaTeX

  1. MathJax supports Unicode characters: $\sin(\theta)$ and $\sin(θ)$ should look exactly the same.
  2. LuaLaTeX has Unicode compatibility, at least in math-mode when using the unicode-math package.
  3. For PDFLaTeX, the package unicode-symbols.sty is provided. (should also work with lualatex)

⚠️ BEWARE ⚠️ If you intend to use https://overleaf.com, this platform only supports the first 65536 Unicode characters (the "basic plane", which includes for instance the Greek letters 𝛼, 𝛽, 𝛾, …). This means that you cannot use any of the characters in the "supplementary planes", for instance the Mathematical Alphanumeric Symbols such as 𝓝 or . If you want to use these characters, you need to compile your document locally (details).

Supported Alphabets

To create single characters of the given alphabet, simply type \<modifier><char><space>.

  • For blackboard bold R, , type \bbR␣.
  • For a circled one, , type \o1␣.
  • For a bold italic capital gamma, 𝜞, type \biGamma␣.
  • For the sub and superscripts, Xᵢ², type X\_i␣\^2␣.
  • For the Roman numeral (this is a single UTF-8 glyph, and not V+I+I+I), type \RM8␣.

Serif Font

family \bf<> \it<> \bi<>
Latin 𝐚𝐛𝐜𝐀𝐁𝐂 𝑎𝑏𝑐𝐴𝐵𝐶 𝒂𝒃𝒄𝑨𝑩𝑪
Greek 𝛂𝛃𝛄𝚨𝚩𝚪 𝛼𝛽𝛾𝛢𝛣𝛤 𝜶𝜷𝜸𝜜𝜝𝜞
Digits 𝟎𝟏𝟐

Sans Serif Font

family \sans<> \bsans<> \isans<> \bisans<>
Latin upper 𝖠𝖡𝖢 𝗔𝗕𝗖 𝘈𝘉𝘊 𝘼𝘽𝘾
Latin lower 𝖺𝖻𝖼 𝗮𝗯𝗰 𝘢𝘣𝘤 𝙖𝙗𝙘
Greek upper 𝝖𝝗𝝘 𝞐𝞑𝞒
Greek lower 𝝰𝝱𝝲 𝞪𝞫𝞬
Digits 𝟢𝟣𝟤 𝟬𝟭𝟮

Specialty Font

family \tt<> \bb<> \frak<> \bfrak<> \scr<> \bscr<>
Latin upper 𝙰𝙱𝙲 𝔸𝔹ℂ 𝔄𝔅ℭ 𝕬𝕭𝕮 𝒜ℬ𝒞 𝓐𝓑𝓒
Latin lower 𝚊𝚋𝚌 𝕒𝕓𝕔 𝔞𝔟𝔠 𝖆𝖇𝖈 𝒶𝒷𝒸 𝓪𝓫𝓬
Digits 𝟶𝟷𝟸 𝟘𝟙𝟚

Numerals

family \<>. \rm<> \RM<>
0
1
2
3

Other Families

family \^<> \_<> \o<> \(<>) \sc<> \fw<>
Latin upper ᴵᴶᴷ ⒶⒷⒸ ᴀʙᴄᴅ ABC
Latin lower ⁱʲᵏ ᵢⱼₖ ⓐⓑⓒ ⒜⒝⒞ abc
Greek upper
Greek lower ᵝᵞᵠ ᵦᵧᵩ
Digits ⁰¹² ₀₁₂ ⓪①② ⑴⑵⑶ 012

Note: Generally here not all characters are available:

Known Issues & Limitations

  • When using the Markdown All in One extension for VS Code, make sure to disable the backspace hotkey, otherwise AutoKey will not be able to insert the Unicode characters.
  • So far was only tested with Ubuntu 20.04 LTS and Autokey 0.95.10
  • Seems to behave weird with Gnome Terminal, no idea what's going on.
  • Can show strange behavior with VS Code.
    • Seems fixable by deleting all [shift]+[insert] hotkeys combinations. (File > Preferences > Keyboard Shortcuts)
    • Our macros here insert symbols with [shift]+[insert] and VS Code seems to mess with that
  • Composed characters seem to not always work as intended, not many editors render them correctly.
  • Doesn't support multiple sub/super-scripts like Julia does (e.g. in REPL, a\^(k)+[TAB]) gives a⁽ᵏ⁾. With AutoKey we need to add the superscripts one at a time.
  • Seems like it doesn't work with a German keyboard because AutoKey interprets \ and [AltGr]+? (what you type on a German keyboard to get backslash) as different things.
  • 2024-04-04: Added transpose and hermitian transpose: A𞁀 and Aᵸ. (use \transpose/\hermitian or provisional \tp/\htp)
  • 2024-04-02: Added missing letter-like symbols
  • 2024-03-08: Revamped the installation script, refactored the installation procedure.
  • 2024-02-27: Added italic and bold italic Greek variants to unicode-symbols.sty.
  • 2024-02-26: Combining subscripts: $xᵢⱼ$ will render identically to $x_{ij}$ ($x_{ij}$).
  • 2024-01-23: ⚠️ New ⚠️: Added unicode-symbols.sty which provides a useful subset of the Unicode characters for usage with pdflatex.

References