i typed special characters with the compose key; cf. https://github.com/kragen/xcompose
not as easy as latex but more compatible
Here's the XCompose file I use:
I've tried replicating this experience in Linux in many different ways over the years, but the best approach was to add `altwin(ctrl_alt_win)` to xkeyboard preferences together with custom `ctrl_space_toggle` for layout toggle. It achieves almost the same effect as Kinto without an additional daemon: physical Alt maps to Ctrl (Cmd in terms of Mac layout), Ctrl works as Super and Super/Win works as Alt — the closest, I think, to Apple keyboard layout. It event works fine in Wayland (sway).
Considering the terminal, remap your favorite terminal emulator to send control codes via Super+A..Z (physical Ctrl+A..Z), and unmap/remap to the required action Ctrl+A..Z (physical "Cmd"+A..Z). It works fine in Konsole and great in Alacritty. (unfortunately, I also have to add a second set of mappings for my native non-latin keyboard layout, because at toolkit-level keys are translated to latin layout, but remapping works only for a single layout).
Of course, it's only a half of the equation. Another part is Option/Compose. On Mac I used MathUnicode.keylayout. It was great, and it was a pleasure to tweak it for my needs. Xkeyboard with .XCompose (e.g. [1]) has two disadvantages: you can't use a key as both Multi key and e.g. Alt modifier simultaneously, and you don't see the composition preview. On Lenovo at least you can use `compose(prsc)` to make your left Win key an «Option-modifier» and its right PrtSc counterpart an «Option-compose». [1]: https://github.com/kragen/xcompose
Maybe one day I will buy another Mac... but shall we prefer comfort to freedom?
You can do that with an .XCompose file in your home directory. See https://github.com/kragen/xcompose for more info.
Google '.xcompose github' (without quotes) and see what you come up with. I use this one, myself:
https://github.com/kragen/xcompose
but there are a lot of others.
For no particularly good reason, and are illegal. I think the Plan9 strategy of considering non-ASCII characters as identifier characters by default is probably a better one than changing the language grammar every time the Unicode standard revs.
(As mentioned in another comment, http://canonical.org/~kragen/setting-up-keyboard.html https://github.com/kragen/xcompose. The Chinese I copied and pasted from http://www.mdbg.net/chindict/chindict.php?page=radicals though.)