How to Create a APL or Math Symbols Keyboard Layout

Advertise Here

, ,

This page shows you how to create a APL (programming language) keyboard layout, on Windows or Mac OS X. Or, creating a math symbols layout for computer languages such as Fortress, Scheme Lisp, Haskell. (See also: Unicode Support in Ruby, Perl, Python, JavaScript, Java, Emacs Lisp, Mathematica.)

APL Symbols in Unicode

APL keyboard layout
APL keyboard layout. img src

Unicode has the complete set of APL chars.

' ( ) + , - . / : ; & l t ; = & g t ; ? [ ] \ _ ¨ ¯ × ÷

APL2 keyboard layout
APL2 keyboard layout. img src

For other chars, such as λ ƒ used by APL derivatives, or Fortress, or other languages, see: Math Symbols in UnicodeArrows in UnicodeComputing Symbols in Unicode.

Unicode Font

First you need to have unicode fonts. See: Best Fonts for Unicode.

Emacs

There are many ways to insert math symbols with emacs.

Insert by Abbrev

You can insert unicode by abbrev. e.g. “alpha” becomes “α”, “rarrow” becomes “→”. Sample code at: Using Emacs's Abbrev Mode for Abbreviation.

This method is good if you need to insert math symbols occasionally. (one flaw with this solution is that emacs abbrev only allow sequence of English letters to be used as input. So, you cannot create “->” as abbrev for “→”.)

Insert by Short Code and a Activation Key

This package lets you type a short code, from 1 to 4 letters, then press 【Shift+Space】 to change it to a math symbol. See: Math Symbols Input Mode (xmsi-mode). (It's designed for inserting math symbols, not designed for APL in particular. By default it does not support all the APL symbols, but you can easily add your own abbrev code to make it so.)

Insert by Key Combo

You can set your keys so that 【Win+‹key›】 or 【Menu+‹key›】 inserts a math symbol. See: Emacs Custom Keybinding to Enhance Productivity.

Mac OS X

If you are on OS X, you can also setup system-wide config to enter complete custom designed unicode layout. Super easy too (though there are a few problem with certain key combo, because they are low level that Apple don't want changed). See: Creating Keyboard Layout in Mac OS X.

Other Solutions for Windows, Mac, Linux

Linux

Here are some linux solutions for APL language. I haven't tried them.

Windows & Mac

Here's a project that has the APL layout made for Mac and Windows, i haven't tried it: http://code.google.com/p/apl-keyboard-layouts/.

On Windows, you might use The Microsoft Keyboard Layout Creator. See: Keyboard Layout & Key Macro tools for Windows. However, i never tried it.

blog comments powered by Disqus