libreoffice-ppt-math
by Pavan Mohan Neelamraju
PowerPoint-style Math AutoCorrect shortcuts for LibreOffice Impress and Writer.
PowerPoint-style Math AutoCorrect for LibreOffice. Type \int_0^1, press Space, get ∫₀¹.
Write maths the way you'd write LaTeX or PowerPoint's linear format, and it turns into clean Unicode as you type, in Impress, Writer or any other app. Powered by Espanso.
https://github.com/user-attachments/assets/04532d7d-3800-45fc-a8ed-c40ffbd63c70
Typing \alpha^2 + \beta^2 -> \infty in LibreOffice Impress (AI-generated).
\mathbb, \mathcal, \mathfrak and bold fonts.snake_case, don't, URLs, 24/7 and file paths are never changed.python3 --version).espanso install libreoffice-ppt-math.x^2, press Space, and you get x².Then open the cheat sheet: every command, with ready-to-type recipes for algebra, calculus, statistics, physics, geometry and more. Do Step 4 below as well, so LibreOffice's own AutoCorrect doesn't interfere.
| You type | You get |
|---|---|
\alpha, \Delta, \infty | α, Δ, ∞ |
x^2, x^{n+1}, x^(n+1), a_{ij} | x², xⁿ⁺¹, xⁿ⁺¹, aᵢⱼ |
\alpha^2, \theta_0, e^{-x^2} | α², θ₀, e⁻ˣ² |
{a+b}^2, \frac{a}{b}^2 | (a+b)², (a/b)² |
\int_0^1, \int_{0}^{\infty} | ∫₀¹, ∫₀^∞ |
\sum_{i=1}^{n}x_i, \prod_{k=1}^n | ∑ᵢ₌₁ⁿ xᵢ, ∏ₖ₌₁ⁿ |
\lim_{x\to0} | lim_(x→0) |
\sqrt{x^2+1}, \sqrt[3]{x} | √x̅²̅+̅1̅, ∛x |
\frac{1}{3}, \frac{a+b}{c}, 1/2 | ⅓, (a+b)/c, ½ |
A\cup{B}, A\cap{B}, x\notin{A}, A\subseteq{B} | A∪B, A∩B, x∉A, A⊆B |
\overline{AB}, \ray{AB}, \line{AB}, \arc{AB}, \angle{ABC} | A̅B̅, A⃗B⃗, A⃖B⃗, A͡B, ∠ABC |
\vec{v}, \hat{x}, \dot{x} | v⃗, x̂, ẋ |
\mathbb{R}, \R^n, \mathcal{L} | ℝ, ℝⁿ, ℒ |
a<=b, a!=b, a->b, p<=>q, a<->b | a≤b, a≠b, a→b, p⇔q, a↔b |
\forall{x}\exists{y}, p\land{q}, \neg{p} | ∀x∃y, p∧q, ¬p |
The full list, with a beginner's guide and troubleshooting, is in the cheat sheet.
Tips
A \cup B gives A ∪ B; \frac{a b}{c} won't work.~ or \,.\frac{\partial{B}}{\partial{c}}), add this line to your Espanso config/default.yml (run espanso path config to find the folder); expressions up to 59 characters then convert:
max_regex_buffer_size: 64
espanso status.package.yml (standard library only, no network; it only reads max_regex_buffer_size from Espanso's default.yml).
Usually pre-installed on Linux and macOS; check with python3 --version.
On Windows the package calls python3; if that command doesn't exist, use the Advanced install below.espanso install libreoffice-ppt-math
espanso install libreoffice-ppt-math --git https://github.com/PavanMohanN/libreoffice-ppt-math --external
Espanso reloads by itself after installing; no restart is needed.
By default the rules work in every application. Each keystroke costs well under a microsecond, but every time you press space after a math expression a Python process starts (~20 ms), and arrows such as -> would also convert in code editors and terminals.
To limit the package to LibreOffice, use an app-specific configuration.
On Linux (X11), if long expressions flicker or leave text behind, LibreOffice is dropping Espanso's fast synthetic keystrokes. Add this line to Espanso's config/default.yml:
disable_x11_fast_inject: true
LibreOffice's AutoCorrect list rewrites some of the same sequences first, which corrupts the result (for example a<->b becomes ←>).
In LibreOffice, open Tools ▸ AutoCorrect Options…:
.*->.* .*<-.* <-> --> <-- <--> .*... 1/2 1/4 3/4 .*(C) .*(R) .*(tm)-->).Or untick Use replacement table to switch LibreOffice's list off entirely.
v_y, lim_(x→0), ∫_(−∞)^∞.\epsilon and \phi follow LaTeX (ϵ, ϕ). Use \varepsilon and \varphi for ε and φ.Espanso types plain text, so the font always comes from LibreOffice. LibreOffice's default fonts (Carlito in Impress, Liberation Sans/Serif in Writer) lack most super/subscripts, accents and many symbols, so LibreOffice borrows each missing character from another font, often a serif one. That gives the mixed look. Two one-time fixes:
--sans-fallback, then restart LibreOffice. It adds a small fontconfig rule (~/.config/fontconfig/conf.d/99-libreoffice-ppt-math.conf) for Carlito, Calibri, Liberation Sans, Arial, Noto Sans, Open Sans, Ubuntu, Cantarell and Helvetica. Delete that file to undo.package.yml is built by generate_rules.py, which is not part of the Hub package.
It lives in the project homepage under scripts/. Download the repository (ZIP), unzip it, and run from that folder. It can:
python3 scripts/generate_rules.py --install --libreoffice-only --buffer-size 64
Remove the Hub/GitHub package first (espanso uninstall libreoffice-ppt-math) so the rules aren't loaded twice.python3 scripts/generate_rules.py --sans-fallbackUSER_SYMBOLS block at the top of the script (for example "\\eps": "ε"), then rerun the install command.--check (finds duplicate copies, clashing triggers and LibreOffice conflicts), --self-test, --try "\int_0^1", --list arrow.On Linux/macOS, bash install.sh and bash uninstall.sh in the repository wrap the same commands.
Found a formula that converts wrongly, or a symbol you miss? Please open an issue with what you typed and what you expected.
Pull requests are welcome. Edit the tables in scripts/generate_rules.py, then run --self-test (it checks over 1,200 conversions, including every example in the cheat sheet) and --cheatsheet to refresh CHEATSHEET.md.
If this saves you time, a ⭐ on GitHub helps other people find it.
espanso uninstall libreoffice-ppt-math
If you installed with the generator, run python3 scripts/generate_rules.py --uninstall instead.