Skip to content

Instantly share code, notes, and snippets.

@andrejbauer
Last active February 7, 2025 15:40
Show Gist options
  • Save andrejbauer/333f81bb7394502a8539ccf93c7d703f to your computer and use it in GitHub Desktop.
Save andrejbauer/333f81bb7394502a8539ccf93c7d703f to your computer and use it in GitHub Desktop.
LaTeX symbols input method for MacOS

LaTeX input method for MacOS

This MacOS input method is based on TeX113 input.

How to install and use the input method

  1. Download the raw format of LaTeX.inputplugin file found here. You must make sure to get the original file in the UTF-16 format (do not attempt to cut and paste). The best way to do this is to download the gist as a ZIP file (there is a button in the upper-right corner), or to clone it.
  2. Double-click on the file LaTeX.inputplugin in Finder. The OS will process it and place the processed file into ~/Library/Input Methods folder. (Do not place it there by hand.)
  3. Logout and login.
  4. Go to โ€œSystem settings โ†’ Keyboard โ†’ Text input โ†’ Editโ€ฆโ€, then press + in lower-left corner to add a new input method. Find โ€œLaTeXโ€ and add it to your input sources (it might be a bit hard to find, it tends to hide under Chinese, Simplified).
  5. Possbily logout and login again if you do not see LaTeX as input source.
  6. Set up a convenient keyboard shortcut for switching between keyboards under โ€œSystem settings โ†’ Keyboard โ†’ Keyboard shortcuts โ†’ Input Sourceโ€

To type ฮฒ switch to the LaTeX input method and type beta and space (no backslash \). Consult LaTeX.inputplugin to see what can be typed.

How to customize the symbols

You may customize the file easily enough, just keep in mind:

  1. The file must be saved in UTF-16 format:

    • Emacs: use C-x C-m f, select utf-16, then save the file.
    • Visual Studio Code: the coding is displayed in the status line at the bottom, on the right. You may click on it to select an encoding.
  2. The input string and the symbol must be separated by a TAB.

๏ปฟ#
METHOD: TABLE
ENCODE: Unicode
PROMPT: LaTeX
VERSION: 1.0
DELIMITER: ,
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
TERMINPUTKEY:
BEGINCHARACTER
alpha ฮฑ
beta ฮฒ
gamma ฮณ
ggamma ฮ“
delta ฮด
ddelta ฮ”
epsilon ฮต
zeta ฮถ
eta ฮท
theta ฮธ
ttheta ฮ˜
iota ฮน
kappa ฮบ
lambda ฮป
llambda ฮ›
mu ฮผ
nu ฮฝ
xi ฮพ
xxi ฮž
pi ฯ€
ppi ฮ 
rho ฯ
sigma ฯƒ
ssigma ฮฃ
tau ฯ„
upsilon ฯ…
phi ฯ†
pphi ฮฆ
chi ฯ‡
psi ฯˆ
ppsi ฮจ
omega ฯ‰
oomega ฮฉ
nabla โˆ‡
hbar โ„
times ร—
otimes โŠ—
oplus โŠ•
ominus โŠ–
odiv โŠ˜
odot โŠ™
boxtimes โŠ 
boxplus โŠž
bowtie โ‹ˆ
leq โ‰ค
le โ‰ค
ge โ‰ฅ
geq โ‰ฅ
prec โ‰บ
preceq โ‰ผ
succ โ‰ป
succeq โ‰ฝ
cdot ยท
bullet โˆ™
ring โˆ˜
ratio โˆถ
prop โˆท
cdots โ‹ฏ
div รท
pm ยฑ
int โˆซ
oint โˆฎ
iint โˆฌ
iiint โˆญ
iiiint โจŒ
oiint โˆฏ
oiiint โˆฐ
sum โˆ‘
prod โˆ
wedge โˆง
and โˆง
vee โˆจ
or โˆจ
neg ยฌ
perp โŠฅ
triangleleft โ—…
triangleright โ–ป
<| โ—…
|> โ–ป
diamond โ—‡
mid โˆฃ
bullet โ€ข
blacksquare โ–ช
qed โ–ช
infty โˆž
forall โˆ€
exists โˆƒ
nexists โˆ„
top โŠค
bot โŠฅ
stile โŠข
|- โŠข
||- โŠฉ
|||- โŠช
dstile โŠจ
|= โŠจ
adjoint โŠฃ
-| โŠฃ
entails โŠข
multimap โŠธ
-o โŠธ
lsemi โ‹‰
rsemi โ‹Š
uplus โŠŽ
pitchfork โ‹”
' โ€ฒ
'' โ€ณ
''' โ€ด
^1 ยน
^2 ยฒ
^3 ยณ
^4 โด
^5 โต
^6 โถ
^7 โท
^8 โธ
^9 โน
^0 โฐ
^- โป
^+ โบ
_1 โ‚
_2 โ‚‚
_3 โ‚ƒ
_4 โ‚„
_5 โ‚…
_6 โ‚†
_7 โ‚‡
_8 โ‚ˆ
_9 โ‚‰
_0 โ‚€
_- โ‚‹
_+ โ‚Š
_a โ‚
_e โ‚‘
_i แตข
_j โฑผ
_o โ‚’
_r แตฃ
_u แตค
_v แตฅ
_x โ‚“
_beta แตฆ
_gamma แตง
_rho แตจ
_psi แตฉ
_chi แตช
^a แตƒ,แดฌ
^b แต‡,แดฎ
^c แถœ
^d แตˆ,แดฐ
^e แต‰,แดฑ
^g แต,แดณ
^h สฐ,แดด
^i โฑ,แดต
^j สฒ,แดถ
^k แต,แดท
^l หก,แดธ
^m แต,แดน
^n โฟ,แดบ
^o ยบ,แดผ
^p แต–,แดพ
^r สณ,แดฟ
^s หข
^t แต—,แต€
^u แต˜,แต
^v แต›,โฑฝ
^w สท,แต‚
^x หฃ
^y สธ
^z แถป
^tm โ„ข
^alpha แต…
^beta แต
^gamma แตž
^delta แตŸ
^epsilon แต‹
^theta แถฟ
^iota แถฅ
^phi แถฒ
^psi แต 
^chi แตก
ast โˆ—
angle โˆ 
"o รถ
surd โˆš
root โˆš
sqrt โˆš
cbrt โˆ›
xbar xฬ„
ftrt โˆœ
-> โ†’
right โ†’
to โ†’
<- โ†
left โ†
dright โ‡’
=> โ‡’
Rightarrow โ‡’
c-> โ†ช
into โ†ช
<= โ‡
dleft โ‡
leadsto โ†
supset โŠƒ
vdash โŠข
vvdash โŠฉ
vvvdash โŠช
cong โ‰…
~= โ‰…
equiv โ‰ก
== โ‰ก
nequiv โ‰ข
~ โˆผ
sim โˆผ
simeq โ‰ƒ
~= โ‰ƒ
~~ โ‰ˆ
approx โ‰ˆ
n~~ โ‰‰
napprox โ‰‰
ll โ‰ช
gg โ‰ซ
box โ–ก
circ โˆ˜
o โˆ˜
circle โ—ฏ
star โ‹†
dag โ€ 
ddag โ€ก
mapsto โ†ฆ
|-> โ†ฆ
propto โˆ
cdot ยท
aleph โ„ต
imath ฤฑ
partial โˆ‚
sharp โ™ฏ
flat โ™ญ
natural โ™ฎ
wp โ„˜
powerset โ„˜
scriptp โ„˜
emptyset โˆ…
ell โ„“
ldots โ€ฆ
cdots โ‹ฏ
urdots โ‹ฐ
drdots โ‹ฑ
in โˆˆ
nin โˆ‰
ni โˆ‹
qed โˆŽ
subset โŠ‚
nsubset โŠ„
subseteq โІ
super โŠƒ
nsuper โŠ…
supereq โЇ
ne โ‰ 
neq โ‰ 
n= โ‰ 
langle โŸจ
rangle โŸฉ
<< โŸจ
>> โŸฉ
th รพ
dh รฐ
because โˆต
divides โˆฃ
parallel โˆฅ
nparallel โˆฆ
1/2 ยฝ,
1/3 โ…“
2/3 โ…”
1/4 ยผ
3/4 ยพ
1/5 โ…•
2/5 โ…–
3/5 โ…—
4/5 โ…˜
1/6 โ…™
5/6 โ…š
1/8 โ…›
3/8 โ…œ
5/8 โ…
7/8 โ…ž
downarrow โ†“
down โ†“
ddownarrow โ‡“
uparrow โ†‘
up โ†‘
uuparrow โ‡‘
searrow โ†˜
swarrow โ†™
nearrow โ†—
nwarrow โ†–
leftrightarrow โ†”
<-> โ†”
<=> โ‡”
iff โ‡”
cap โˆฉ
intersect โˆฉ
cup โˆช
union โˆช
sqcup โŠ”
[[ โŸฆ
]] โŸง
scrA ๐’œ
scrB โ„ฌ
scrC ๐’ž
scrD ๐’Ÿ
scrE โ„ฐ
scrF โ„ฑ
scrG ๐’ข
scrH โ„‹
scrI โ„
scrJ ๐’ฅ
scrK ๐’ฆ
scrL โ„’
scrM โ„ณ
scrN ๐’ฉ
scrO ๐’ช
scrP ๐’ซ
scrQ ๐’ฌ
scrR โ„›
scrS ๐’ฎ
scrT ๐’ฏ
scrU ๐’ฐ
scrV ๐’ฑ
scrW ๐’ฒ
scrX ๐’ณ
scrY ๐’ด
scrZ ๐’ต
bbA ๐”ธ
bbB ๐”น
bbC โ„‚
CC โ„‚
bbD ๐”ป
bbE ๐”ผ
bbF ๐”ฝ
bbG ๐”พ
bbH โ„
bbI ๐•€
bbJ ๐•
bbK ๐•‚
bbL ๐•ƒ
bbM ๐•„
bbN โ„•
NN โ„•
bbO ๐•†
bbP โ„™
bbQ โ„š
QQ โ„š
bbR โ„
RR โ„
bbS ๐•Š
bbT ๐•‹
bbU ๐•Œ
bbV ๐•
bbW ๐•Ž
bbX ๐•
bbY ๐•
bbZ โ„ค
ZZ โ„ค
par โ…‹
deg ยฐ
sqcap โŠ“
sqcup โŠ”
lfloor โŒŠ
|_ โŒŠ
rfloor โŒ‹
_| โŒ‹
ENDCHARACTER
@Banus
Copy link

Banus commented Feb 7, 2025

Wonderful idea!
I created a variant in this gist using .cin files because the .inputplugin format doesn't support shortcuts differing only by capitalization and I wanted to support all the shortcuts from the Lean 4 VSCode plugin (here).

@andrejbauer
Copy link
Author

andrejbauer commented Feb 7, 2025 via email

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