10

I've recently been writing a lot of documentation and would love to be able to type native superscript characters (⁰, ¹, ², ³, ⁴, ⁵) to call out caveats/annotations. The writing environment I'm in does not support markup such as <sup> or LaTeX-like ^1 ^2 ^3 ^4 ^5.

My current solution for inserting these characters is to;

  1. Permanently enable the "input menu in menu bar" in Keyboard.prefPane -> Input Sources
  2. Mouse over to the input menu icon, click it, then 'Show Character Viewer'.
  3. Once the Character Viewer is shown, mouse to the character search box, and type either the number to superscript, or literally enter the word 'superscript' which will helpfully give me 0-9 that I can quickly use if necessary.

How can I shorten the time necessary to input these characters?

  • This is related to or a duplicate of apple.stackexchange.com/questions/183045/…, but the specific details of Unicode codepoints (what's a Unicode?) causes it to be difficult to search for imo. I'm fine with it being closed if it is deemed necessary, I just want this question/answer to remain for search fodder. – Jason Salaz Jul 10 '18 at 9:33
  • I like having a link if you want to edit how it’s related in your answer. This question is all about fast focus - the other question has a lot else going on. – bmike Jul 10 '18 at 10:38
  • Possible duplicate of What do I type to produce the command symbol (⌘) in Mac OS X? – Tim Jul 11 '18 at 9:24
15

I had thought that the command + control + space (⌘^␣) picker was emoji-only, boy was I mistaken. Or perhaps it's changed since I last looked inevitably 1-3 releases of macOS ago?

Screenshot of the Character Viewer in command+ctrl+space popover mode with '1' entered in the search bar

This is absolutely the fastest way to enter any character, provided it's unicode name isn't overly esoteric.

  • How do I input those keys you called out? cmd+6+underscore doesn't work. Neither does cmd+shift+6+underscore. I'm new at this. – spacetyper Jul 10 '18 at 17:59
  • 7
    @spacetyper those are the shortcut characters in Mac - the caret is used to denote Ctrl and the last one is not an underscore, that's a (U+2423 Open Box) character, which is used to denote a space. Thus, the goal would be cmd+ctrl+space. See here – Delioth Jul 10 '18 at 18:18
  • @spacetyper see apple.meta.stackexchange.com/q/193/1346 for lots of fantastic information about our Keyboard shortcut standards, and labeling on macOS. – Jason Salaz Jul 10 '18 at 19:54
13

Set up text replacements for your characters in system preferences/keyboard/text/replace with

enter image description here

1

I have created an Alfred workflow which runs the script filter below. The script filter is connected to a "Copy to Clipboard" action where the "Automatically paste to front most app" option is selected.

awk 'FILENAME==ARGV[1]{a[tolower($0)];next}{for(i in a)if(!index(tolower($0),i))next}1' <(printf %s\\n {query}) unicode|sed 's/&/\&amp;/g;s/</\&lt;/g;s/>/\&gt;/g;s/"/\&quot;/g'|awk -F\; '{print"<item><arg>"$1"</arg><title>"$1,$2,$3"</title><icon></icon></item>"}'|echo "<?xml version='1.0'?><items>$(cat)</items></xml>"

The unicode file contains the output of the command below. \U and \u were added in Bash 4.2.

curl www.unicode.org/Public/UNIDATA/UnicodeData.txt|while read l;do [[ ${l#*;} != @(<|SEMICOLON;)* ]]&&printf \\U$(printf %08d $((0x${l%%;*})));printf ';%s\n' "$l";done|cut -d\; -f-3

This is what the workflow looks like:

I also use the ug function below to search for Unicode characters in a shell. ~/f/unicodedata is a version of the UnicodeData.txt file which includes a field for the literal character at the start of each line. ga prints the lines of STDIN which contain each argument as a substring.

ga(){ awk 'FILENAME==ARGV[1]{a[tolower($0)];next}{for(i in a)if(!index(tolower($0),i))next}1' <(printf %s\\n "$@") -;}
ug(){ ga "$@"<~/f/unicodedata;}

Example output:

$ ug superscript
²;00B2;SUPERSCRIPT TWO;No;0;EN;<super> 0032;;2;2;N;SUPERSCRIPT DIGIT TWO;;;;
³;00B3;SUPERSCRIPT THREE;No;0;EN;<super> 0033;;3;3;N;SUPERSCRIPT DIGIT THREE;;;;
¹;00B9;SUPERSCRIPT ONE;No;0;EN;<super> 0031;;1;1;N;SUPERSCRIPT DIGIT ONE;;;;
 ٰ;0670;ARABIC LETTER SUPERSCRIPT ALEF;Mn;35;NSM;;;;;N;ARABIC ALEF ABOVE;;;;
 ܑ;0711;SYRIAC LETTER SUPERSCRIPT ALAPH;Mn;36;NSM;;;;;N;;;;;
⁰;2070;SUPERSCRIPT ZERO;No;0;EN;<super> 0030;;0;0;N;SUPERSCRIPT DIGIT ZERO;;;;
ⁱ;2071;SUPERSCRIPT LATIN SMALL LETTER I;Lm;0;L;<super> 0069;;;;N;;;;;
⁴;2074;SUPERSCRIPT FOUR;No;0;EN;<super> 0034;;4;4;N;SUPERSCRIPT DIGIT FOUR;;;;
⁵;2075;SUPERSCRIPT FIVE;No;0;EN;<super> 0035;;5;5;N;SUPERSCRIPT DIGIT FIVE;;;;
⁶;2076;SUPERSCRIPT SIX;No;0;EN;<super> 0036;;6;6;N;SUPERSCRIPT DIGIT SIX;;;;
⁷;2077;SUPERSCRIPT SEVEN;No;0;EN;<super> 0037;;7;7;N;SUPERSCRIPT DIGIT SEVEN;;;;
⁸;2078;SUPERSCRIPT EIGHT;No;0;EN;<super> 0038;;8;8;N;SUPERSCRIPT DIGIT EIGHT;;;;
⁹;2079;SUPERSCRIPT NINE;No;0;EN;<super> 0039;;9;9;N;SUPERSCRIPT DIGIT NINE;;;;
⁺;207A;SUPERSCRIPT PLUS SIGN;Sm;0;ES;<super> 002B;;;;N;;;;;
⁻;207B;SUPERSCRIPT MINUS;Sm;0;ES;<super> 2212;;;;N;SUPERSCRIPT HYPHEN-MINUS;;;;
⁼;207C;SUPERSCRIPT EQUALS SIGN;Sm;0;ON;<super> 003D;;;;N;;;;;
⁽;207D;SUPERSCRIPT LEFT PARENTHESIS;Ps;0;ON;<super> 0028;;;;Y;SUPERSCRIPT OPENING PARENTHESIS;;;;
⁾;207E;SUPERSCRIPT RIGHT PARENTHESIS;Pe;0;ON;<super> 0029;;;;Y;SUPERSCRIPT CLOSING PARENTHESIS;;;;
ⁿ;207F;SUPERSCRIPT LATIN SMALL LETTER N;Lm;0;L;<super> 006E;;;;N;;;;;
ﱛ;FC5B;ARABIC LIGATURE THAL WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL;<isolated> 0630 0670;;;;N;;;;;
ﱜ;FC5C;ARABIC LIGATURE REH WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL;<isolated> 0631 0670;;;;N;;;;;
ﱝ;FC5D;ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL;<isolated> 0649 0670;;;;N;;;;;
ﱣ;FC63;ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM;Lo;0;AL;<isolated> 0020 0651 0670;;;;N;;;;;
ﲐ;FC90;ARABIC LIGATURE ALEF MAKSURA WITH SUPERSCRIPT ALEF FINAL FORM;Lo;0;AL;<final> 0649 0670;;;;N;;;;;
ﳙ;FCD9;ARABIC LIGATURE HEH WITH SUPERSCRIPT ALEF INITIAL FORM;Lo;0;AL;<initial> 0647 0670;;;;N;;;;;
$ ug superscript paren
⁽;207D;SUPERSCRIPT LEFT PARENTHESIS;Ps;0;ON;<super> 0028;;;;Y;SUPERSCRIPT OPENING PARENTHESIS;;;;
⁾;207E;SUPERSCRIPT RIGHT PARENTHESIS;Pe;0;ON;<super> 0029;;;;Y;SUPERSCRIPT CLOSING PARENTHESIS;;;;

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.