Aral Balkan

Mastodon icon RSS feed icon

Typographical typing habits for Linux

Photo of antique typewriter

Many of our bad habits date back to the limitations of typewriters.

Typography lends us the voice that the written word takes away from us. Good typography makes your message accessible and comprehensible and strengthens its intent. Bad typography can have the opposite effect: it can cloud your meaning and give you a raspy voice.

I first started making an effort to write using semantic typographical habits about six years ago. This involved, among other things, memorising the various keyboard shortcuts on macOS for printing typographical quotes instead of typewriter quotes and using en dashes, em dashes, and the minus sign for their allotted purposes instead of hyphen-dashes for everything like a caveman that thinks everything is a nail because all he has is a tiny little club1.

Switching to Linux means that I have to learn new habits2.

Some environments provide automatic conversion of such things (i.e, “smart quotes” functionality) and some even do it well. I strongly support such efforts and believe they should be the norm. However, it’s still a good habit to get into to write using semantic typography to begin with. Not least because smart quotes is not a universal feature and even the best implementations won’t necessarily cover all typographical elements.

Alt Graph and Compose keys

When seeking to develop good typographical typing habits on Linux, you have two friends you can count on: the Alt Graph key (AltGr) and the Compose key.

More than likely, if you’re not on a touch-based device, you can see the AltGr key on the keyboard in front of you. You might be wondering about the other one, however. That’s because the Compose doesn’t exist on modern keyboard. You can, however, easily map an existing key to be your compose key under Gnome. We’ll see how after the next section.

The Alt Graph Key

Let’s start with the simpler of the two methods; the one that works right out of the box.

The AltGr key modifier, combined with the Shift key modifier, exposes two separate layers of characters on the keyboard. Using the AltGr key, you can easily enter a number of useful everyday characters including the following3:

Key(s) Character Description
v Open double curly quotes
b Close double curly quotes
Shift v Open single curly quote
Shift b Open single curly quote
Shift 3 # Octothorpe
, Minus
Shift , × Multiplication
. · Middle dot
Shift . ÷ Division
Shift c © Copyright
y Left arrow
i Right arrow
u Down arrow
Shift u Up arrow

So those are glyphs that you can start to use right away via the AltGr key. For the second method, you’re going to have to install a Gnome app.

The Compose Key

Screenshot of the Gnome Tweaks app, showing the Compose Key setting under the Keyboard & Mouse section

A cheeky tweak gets you the coveted Compose key.

The Compose key, introduced in 1983, never became a standard but it is hugely useful and rather delightful to use nevertheless. It’s based on the concept of using a mnemonic sequence of easy-to-type characters to specify glyphs that are not readily available on your keyboard.

To set up and use your Compose key:

  1. Install and launch Gnome Tweaks

  2. Navigate to Keyboard & Mouse and choose a Compose Key.

Screenshot of the compose key selection dialog.

Turn it on and choose a key.

Initially, I set my Compose key to Scroll Lock while using my external keyboard4, only to discover that my laptop didn’t have one. So now I use Caps Lock, an otherwise rather useless key when you think about it.

To enter extended characters with this method, you press the Compose key followed by a key combination. The key combinations are delightfully clever and make a huge amount of sense.

Here are some examples of the most useful ones I’ve discovered so far:

Keys Keys (spelled out) Character Description
–. dash-dash-dot en-dash
dash-dash-dash em-dash
.. dot-dot ellipsis
.- dot-dash · middle dot
.= dot-equals filled bullet
oc o-c © copyright
tm t-m trademark
c= c-equals Euro
c/ c–forward slash ¢ Cent
l- l-dash £ Pound
-> dash–greater than Right arrow
-< less than-dash Left Arrow
xx x-x × Multiplication
-: dash-colon ÷ Division
=/ equals–forward slash Not equal to
12 one-two ½ Half
34 three-four ¾ Three quarters
^0 caret-zero Superscript zero
^9 caret-nine Superscript nine

If the built-in ones do not meet your needs, you can also add custom Compose key sequences.

I hope you find this useful and that it helps you express yourself better while typing on a Linux machine. If you have any favourite glyphs that I’ve missed, let me know via Mastodon.

References

Credits


  1. Yakub Marian has a beautifully-written and comprehensive article titled Hyphen, minus, en-dash, and em-dash: difference and usage in English that I strongly urge you to read. ↩︎

  2. And that’s part of the fun. You always learn the most when you force yourself outside of your comfort zone. In the last two weeks alone I’ve learned heaps about how operating systems boot (due to an issue I had while trying to install first Ubuntu 18.04 and then Pop!_OS on my XPS 13) and about flashing ROMs onto mobile phones. (I’m also switching my main phone to LineageOS and I had an issue with the camera not working on my S9+ so I had to revert back to the stock ROM.) ↩︎

  3. The key sequences listed in the Alt Graph Key section are from my keyboard layout, which is English (UK, Macintosh). The actual physical keyboard layout I use is ISO. The exact combinations may vary depending on specific setup. ↩︎

  4. The excellent Filco Majestouch 2 Ninja Tenkeyless. ↩︎