Personally I like being able to type math symbols on occasion but don't do so often enough to benefit from a custom keyboard layout that I'd then have to memorize. I didn't have a good way to do this until about a year ago, when I learned about Espanso [1] which is a cross-platform text expander. I installed it and set it up to substitute various (vaguely LaTeX-inspired) macros to UTF-8 strings. For example, typing the following keystrokes
x = R cos(:phi) sin(:lambda :minus :lambda:nought)
becomes x = R cos(φ) sin(λ − λ₀)I chose ':' as a prefix for all my macros but this is just a self-enforced convention; you can configure a substitution for any sequence of keystrokes. Since I gave all the characters names that made sense to me, I don't have to think much when I type them.
A few of the substitutions I get the most mileage out of:
- The Greek alphabet, both upper and lowercase (:theta → θ and :Omega → Ω)
- Double-struck letters for numerical sets; e.g. :RR → ℝ
- :infinity → ∞
- :neq → ≠
- :pm → ±