Shortcut so that Alt + a gives ā, alt+e = ē, etc..?

[Concerning LibreOffice Writer 6.4.4.2 (x64)]

Dear all,

What I want is a shortcut for macrons, preferably a shortcut that makes ALT + vowel put a macron on top of it, i.e. turn a, e, i, o, u, y into ā, ē, ī, ō, ū, ӯ. It would be cool with Greek as well α → ᾱ; ι → ῑ ; υ → ῡ.

Back in the OpenOffice days, I remember going to Tools, Customize, Keyboard and then scrolling a list of Unicode characters while ascribing certain shortcuts to them. When I do the same in LibreOffice, I can’t seem to find such a list of Unicode characters. I’ve tried all the different categories in the list under ‘‘Category’’ and scanning all their ‘‘functions’’. What am I overlooking?

There are some answers around, but they give all sorts of creepy macros. I don’t want macros. Macros are scary and have all sorts of weird colours. I just want Alt + a = ā.

Looking forward to any help! Warm regards.

For a complete keyboarding solution, use 3rd party software such as Keyman, which is now free.

As for Greek, try OOoFBTools. This extension has a couple of virtual keyboards, including a Greek one (with polytonic characters as well).

As for Latin, it depends on the operating system. Linux allows to use compose sequences to type letters with macrons and many, many other ones.

I installed AutoHotkey and followed this very straight forward tutorial by a Danish guy: https://youtu.be/lxLNtBYjkjU

This is the script I activated:

!a::
Send, ā
return

+!A::
Send, Ā
return

!e::
Send, ē
return

+!E::
Send, Ē
return

!i::
Send, ī
return

+!I::
Send, Ī
return

!o::
Send, ō
return

+!O::
Send, Ō
return

!u::
Send, ū
return

+!U::
Send, Ū
return

!y::
Send, ȳ
return

+!Y::
Send, Ȳ
return

!α::
Send, ᾱ
return

+!Α::
Send, Ᾱ
return

!ι::
Send, ῑ
return

+!Ι::
Send, Ῑ
return

!ῡ::
Send, ῡ
return

+!Υ::
Send, Ῡ
return

Good that you have found an answer suitable for you and published it!

You forgot to mention a very important piece of information: AutoHotKey is Windows-only!

I suggest you configure your own AutoCorrect rules.

Tools>AutoCorrect>AutoCorrect Options opens the configuration dialog. The Replace tab contains all replacement sequences.

You can define your own. Without precaution, it works when the sequence is recognised as a “word”, i.e. surrounded by spaces or punctuations. Since you want to add diacritics to vowels, it is likely that this will occur inside a word, not as a stand alone sequence.

Choose a convenient unique prefix for your custom rules. I’ll use $$ in the examples below.

Have a Unicode character chooser at hand to copy the composed characters.

Enter a new trigger in Replace as .*$$a.* for the a+macron and paste the U+0101 LATIN SMALL LETTER A WITH MACRON from the character chooser in the With box.

Press New. Repeat for each composed character.

In the replace pattern above .* means that any prefix or suffix may precede/follow the pattern. Therefore the sequence is not a “word”.

When you type your text $$a will get replaced by ā as soon as you type a space or punctuation (replacement is differed until end of word).

This is not exactly what you requested but it should be equally convenient and likely more versatile.

EDIT

To make your rules available for new documents, store them in a template and base your new documents on this template.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

When you type your text $$a will get replaced by ā as soon as you type a space or punctuation

Make it, say, :$$a:, and it will work inside words.

@gabix: does not work here (Fedora 32, LO 6.4.4.2) and you must type the colons too. More exactly, depends on the locale (whether : is itself autocorrected or not). For reliable replacement inside words, use .* pattern instead of the shortcut :.

Works for me on LibreOffice 6.4.2.2 / openSUSE Leap 15.1. Yes, needs typing extra colons, but, again, works inside words.

But who needs it under Linux? Compose - a, and you get it.

I checked compose method on my box. It relies on transformations through a table. The en_US.UTF-8 seems quite exhaustive but you must learn the trigger. Unfortunately, it seems many locales are missing. Also it is located in an …/X11/… directory. What happens with Wayland?

As an alternative, there is the <hexa_code> Alt+X method; inconvenient: you must know the encoding of the character.

All in all, I think OP’s request is the best for one’s workflow: the trigger is chosen to be meaningful for the individual, adapted to the work in progress and somehow minimises the number of character to type.

In my experience, compose sequences work independently or the locale.

If you want to minimize the keystrokes, use the right layout. Or even create your own, engaging Shift Level 3.