26

I'd like to type macrons on (OS X | Windows | Ubuntu | other), but my keyboard doesn't have an ā key. How can I add macrons to my vowels?

I don't want to copy them from this strangely convenient list: ā ē ī ō ū ȳ.

10 Answers 10

15

On OS X, it's easy. Just hold down the vowel you want and select the macron-ized version: ā.

enter image description here

If you're typing a lot of these, I'd recommend adding "ABC Extended" as a keyboard layout (in System Preferences > Keyboard > Input Sources. Now you can type alta, then the vowel: ā ē ī

enter image description here


Or, if you like, you can copy them from here: ā ē ī ō ū ȳ.

3
  • What exactly do you mean by "hold down"? Surely not the physical key?
    – Cerberus Mod
    Commented Nov 29, 2016 at 7:15
  • 1
    Yes, the physical key @Cerberus. Might need to toggle a setting somewhere to enable it instead of repeating.
    – user11
    Commented Oct 7, 2017 at 12:53
  • Hey, hello! Hmm I see, so you have to hold down the u key, then perform certain actions to 'select' ū. It's good to have an as option, I'm sure! But I find Autohotkey to be quite a bit more efficient, no offence!
    – Cerberus Mod
    Commented Oct 8, 2017 at 9:19
10

I use HTML entities:

ā ā
ē ē
ī ī
ō ō
ū ū

Oddly, you can't just substitute y into any of the above. You'll need

ȳ ȳ

Which is unfortunately not so easy.

2
  • 1
    Looks like you can use, e.g., Ā for capital vowels.
    – hBy2Py
    Commented Feb 23, 2016 at 20:52
  • 4
    Similarly, Ȳ should work for capital 'y'.
    – hBy2Py
    Commented Feb 23, 2016 at 21:08
7

For Windows users, the Maori (New Zealand) keyboard allows easy addition of macrons to all vowels except y.

From the Control Panel, go to Region and Language, then click Change Keyboards..., then Add. Then select Maori's keyboard:

Maori keyboard

Enabling this keyboard modifies the behavior of the ` key:

Affected key

Tap ` + a to get ā. Tap ` + ` to get the grave accent itself.

2
  • 2
    You could also install the keyboard for Latvian. With the Latvian QWERTY keyboard in Windows, you add macrons using the alt key, although there is no long 'y' either.
    – neubau
    Commented Feb 26, 2016 at 3:01
  • @neubau - Since ō is not used in the Latvian language, in the Latvian QWERTY keyboard in Windows Alt Gr + o gives the Estonian / Livonian letter õ.
    – Yellow Sky
    Commented Jul 22, 2020 at 12:25
7

The most convenient way I've ever seen happens on Linux. You can use the compose key. Then you simply type Compose, -, o to get an ō. Or you type Compose, ^, o to get an ô.

Beautiful in its simplicity.

Besides, should you be learning Greek, you can setup your own .XCompose so as to be able to denote the vowel length in the Greek alphabet (not sure if it's enabled by default)

2
  • Nice! Too bad it does not work in Emacs(23). The response: <Multi_key> is undefined Commented Apr 7, 2016 at 5:03
  • Note that by default in X, 'Compose' is Shift+Alt Gr. If you're typing latin a lot, it's probably worth remapping it to just Alt Gr, or left Ctrl, or something. There are various ways of doing this! Commented Apr 16, 2019 at 14:57
7

On Windows, there does not seem to be a simple way for direct entry of macron vowels that is enabled by default. Matt Gutting's HTML entities are a pretty good option for questions and answers, but they appear not to work in comments.

The "most straightforward" method for direct insertion of Unicode characters appears to be the second approach described here, which involves modifying the registry (not for the faint of heart!) and then logging out and back in (or rebooting).

  1. Press Win+R to open the "Run..." dialog
  2. Enter regedit and press Enter to load the registry editor

Run dialog for regedit
Click images here and below for larger versions

  1. In Registry Editor, browse to the key HKEY_CURRENT_USER\Control Panel\Input Method

Regedit nav to Input Method key

  1. Right-click and select New > String Value

Right-click and add new string value

  1. Name the new string value EnableHexNumpad

Naming the new value

  1. Double-click the new value, enter 1 as the value, and click OK
  2. Close the Registry Editor
  3. Log out and back in, or reboot.

The Unicode characters can then be entered by holding Alt, pressing the following key sequences, then releasing Alt. The leading + is the keypad 'plus' in all cases, and letters are entered using the regular keyboard keys:

Ā: +0100
Ē: +0112
Ī: +012a
Ō: +014c
Ū: +016a
Ȳ: +0232

ā: +0101
ē: +0113
ī: +012b
ō: +014d (this one messes up because Alt+D activates the address bar :-/ )
ū: +016b
ȳ: +0233

7
  • 2
    @ElliotA. Agreed, for most users Matt Gutting's approach is far superior. I'd already gotten most of the way through working up the post before he posted his, though, so I just went ahead and finished it. <shrug>
    – hBy2Py
    Commented Feb 23, 2016 at 22:08
  • Frankly, I concur with the -1 vote total on this answer at present. :-D
    – hBy2Py
    Commented Feb 25, 2016 at 2:36
  • Inventive! Even though this is probably less practical in most cases, it is good to know that it is possible.
    – Cerberus Mod
    Commented Feb 27, 2016 at 23:37
  • @Cerberus Yeah, opening up Alt-key access to the full Unicode character set promises to be terrifically handy in a wide variety of contexts.
    – hBy2Py
    Commented Feb 28, 2016 at 3:21
  • @ElliotA. I see no possible way that this could "ruin" a computer; just because it involves modifying the registry does not mean that potential destruction can follow. I for one find this method incredibly useful; I need to be able to type a variety of accents, diacritics, etc., to which I need to be able to assign custom keys, which the default Windows keyboards (like the Maori keyboard) can't provide. Commented Oct 9, 2018 at 14:33
  • @EthanBierlein wow, that was a comment from a while ago. I was completely wrong, I realize that now.
    – Elliot A.
    Commented Feb 27, 2019 at 4:47
  • I know this is an ancient post at this point, but I just wanted to chime in and say that for my use-case, this is the superior method for Windows because it's native and can be used for Discord, Word Processors, etc. — it's not limited to things that are able to render HTML entities.
    – QMord
    Commented Nov 19, 2022 at 21:57
6

The most convenient way to type macra in Windows is by using the marvellous programme Autohotkey. If you install Autohotkey and run the following script at startup, you can easily type macros by typing e-=- etc. Advantages:

  • Easily adjustable to your preferences.
  • You don't need to reach for faraway or unusual keys on your keyboard to type a special character.
  • You don't need to hold down any modifier keys.
  • You can add the macron after you have already typed the vowel. So you type para, then you think, oh, I wanted a macron on that a, so you type -=- (or whichever characters you have set up) and it appears. You can also type parare, then backspace twice, then -=- and it will appear on the a you typed earlier.
  • You can do this for any character you often type. I also have e.g. e\/ set up to turn into ĕ, etc. I can give you my full script in case you're interested.

You can of course change the -=- into anything you want. Just make sure it is a combination you don't normally type. Just to be sure, you can make the hotkeys work only in certain windows, for example:

SetTitleMatchMode 2

#If Winactive("Firefox Latin Language Stack Exchange")
or Winactive("the title of some other window")

:*?:a-=-::ā
:*?:e-=-::ē
:*?:i-=-::ī
:*?:o-=-::ō
:*?:u-=-::ū
:*?:y-=-::ȳ

Copy-paste this code into a text file, then save the file as a unicode file (the format should probably be UTF-8) with an extension .ahk and have it run on startup.

You can also make it type words or sentences by adding lines like this:

:*?:tllqq::Thesaurus Linguae Latinae
1

There is a HTML entity that puts a macron on the preceding character: &#772; (also &#x304;). For example, A&#772; becomes Ā and y&#772; becomes ȳ. It is hard to remember, but on the other hand it works with any letter.

The breve counterpart is &#774; (also &#x306;). With these you can easily speak about vowel length in general: V̄ is longer than V̆.

1

in emacs

M-x set-input-method latin-alt-postfix

type

ama-re, amo-, ama-s, amat, ama-mus, ama-tis, amant

get

amāre, amō, amās, amat, amāmus, amātis, amant

1

On Android there is a actual Latīna keyboard:

https://play.google.com/store/apps/details?id=klye.plugin.la&hl=en_US

It's a plugin for the multiling-O keyboard app, which you also need to install.

It's a bit 'busy' by default, but if you fiddle with the settings you can cut it all down to a nice qwerty+macrons arrangement.

1

For Linux Mint (I think it will also work for other distributions, but I didn't check) you can create a custom keyboard layout.

This custom layout will let you press RightAlt (careful, it doesn't work with LeftAlt) and a vowel to get that same vowel with a macron.
For example:
RightAlt+a results in 'ā'.
RightAlt+Shift+a results in 'Ā'.
etc.

I used this site as a reference for what I'll write next.

Tutorial starts here
We will derive this custom layout from English (US).
To do this use this command cd /usr/share/X11/xkb/symbols.
Then use your preferred editor to create a file named latinmacrons in which you should paste this text:

default partial alphanumeric_keys
xkb_symbols "basic" {
   include "us"

    name[Group1]="Latin (Custom Layout)";

    key <AC01> { [            a,           A,            U0101,       U0100 ] };
    key <AD03> { [            e,           E,            U0113,       U0112 ] };
    key <AD08> { [            i,           I,            U012B,       U012A ] };
    key <AD09> { [            o,           O,            U014D,       U014C ] };
    key <AD07> { [            u,           U,            U016B,       U016A ] };
    key <AD06> { [            y,           Y,            U0233,       U0232 ] };

    include "level3(ralt_switch)"
};

Save the file and exit your editor.
Now use this command cd /usr/share/X11/xkb/rules and open the file evdev.xml with your editor.
Inside evdev.xml search for </layoutList> and insert above it this text:

<layout>
  <configItem>
    <name>latinmacrons</name>
    <shortDescription>Latin (Custom Layout)</shortDescription>
    <description>Latin (Custom Layout)</description>
    <languageList>
      <iso639Id>lat</iso639Id>
    </languageList>
  </configItem>
  <variantList>
  </variantList>
</layout>

Save the document and reboot.

After the reboot you should find your layout among the other layouts in the keyboard settings.
It should be named Latin (Custom Layout), just select it.
Alternatively you can use setxkbmap -layout latinmacrons to test the layout .

Now you should be able to write macrons using RightAlt in combination with the desired vowel.

You must log in to answer this question.