danzilberdan33k downloadsVisual LaTeX math editor with formula OCR. Scan screenshots, PDFs and handwriting into editable equations.
Write math in Obsidian visually, and turn screenshots of formulas into LaTeX.
MathLive replaces the LaTeX in your notes with a visual math editor. Click a formula to edit it like you would in a word processor, open a larger editor window with an on-screen math keyboard, or draw a box around a formula in a PDF or slide and scan it straight into your note.
$...$ and block $$...$$ math turn into live editors in Live Preview. Inline formulas stay at text height, so your paragraphs don't jump around.Ctrl/Cmd + Enter to insert into the note.al and Space for \alpha, sq for a square root, or your own shorthands, in the visual editor and in typed LaTeX. Imports your Quick Latex shortcuts and works alongside Latex Suite.
Or open MathLive in Obsidian directly. MathLive works in Obsidian 1.1.0 or newer, on desktop and on mobile (iPhone, iPad and Android).
Edit a formula in your note. Write $x^2$ or a $$ block in Live Preview and click it. Type to edit, use the arrow keys to move in and out of the formula, click ✨ to fill it in from a screenshot, or ⤢ to expand it into the editor window. ✨ also opens the guide, which shows everything MathLive can do.
Use the editor window. Open the command palette (Ctrl/Cmd + P) and run MathLive: Add inline math or MathLive: Add full-line math. If you selected a formula first, the editor window opens with it. Click Insert or press Ctrl/Cmd + Enter to put it in your note.
Set a hotkey. If you write math often, assign hotkeys to the commands in Settings → Hotkeys.
New to LaTeX? Click ? in the editor window, or Help: how to… in the ✨ menu, and ask things like "how do I write a fraction" or "make a matrix". You get the answer right there, with a link to the exact section of the MathLive docs. The search runs on your device, so it works offline and sends nothing anywhere.
MathLive keeps your typing habits and adds a visual editor and formula scanning on top.
key:::LaTeX; format, or click Import from Quick Latex. In a formula, type a shorthand and press Space.$ signs to it, so nothing expands twice. Shorthands in typed LaTeX in the settings changes this.From the screen. Open the PDF, slide or image next to your note, put the cursor where the formula should go, and click ✨ in the left ribbon and pick Scan formula from screen (or run MathLive: Scan formula from screen, which you can give a hotkey). Obsidian steps aside and you drag a box around the formula anywhere on your screen, in Obsidian or in another app such as your browser or slides. Its LaTeX goes into the note at the cursor: as a math block on an empty line, or as inline math in a line of text. Press Esc to cancel. The editor window and a formula's ✨ menu have Scan from screen too, which adds the scan to that formula. On macOS, scanning other apps needs Screen Recording access for Obsidian; until then scans stay inside Obsidian's window and MathLive shows you where to turn it on. To always scan inside Obsidian only, turn off Scan other apps in the settings.
From the clipboard. Copy a screenshot of a formula, for example from another app or handwritten notes, then choose Scan clipboard image from ✨ AI fill in the editor window or next to a formula.
From a photo. On a phone or tablet, tap ✨ next to a formula, or in the editor window, and pick Scan a photo. Your device's image picker opens, where you can take a picture of a textbook or whiteboard or choose one from your photos. To put the formula in the note at the cursor, pick Scan a photo from ✨ in the ribbon, or run MathLive: Scan formula from a photo. On a computer, the same command scans an image file.
From an image in your note. Run MathLive: Scan formula from an image in this note, or right-click (on a phone, long-press) the line with the image and pick Scan this image with MathLive. The formula goes under the image as a math block. An image file's menu in the file list has Scan formula with MathLive too.
Check the result and fix anything the scanner got wrong.
Put the cursor where the formula should go and run MathLive: Find a formula (or right-click in the note, or choose Find a formula from ✨ in the left ribbon, a formula's ✨ menu or the editor window). Type its name ("ideal gas law"), what it does ("energy of a moving object"), its name in your language ("Satz des Pythagoras"), or part of it in LaTeX (E=mc^2). Press Enter to insert the highlighted formula: as a math block on an empty line, as inline math in a line of text, or into the formula you opened it from. If you selected some words first, the search starts with them.
Searching is free and needs no account. The library comes from Wikidata's formulas, with clean LaTeX, names, variables and descriptions written and checked with AI, and it grows from the searches that find nothing. When nothing fits, the last choice is ✨ Write it with AI: Claude writes the formula for one scan, charged only when it comes back as valid LaTeX (free on paid plans).
Put the cursor where the formula should go, click ✨ in the left ribbon and pick Draw formula (or run MathLive: Draw formula). The editor window and a formula's ✨ menu have Draw formula too, which adds the drawing to that formula. Write the formula on the pad with your mouse, pen or finger; a moment after you lift the pen, the formula appears under the pad, where you can still fix it. Insert puts it in the note and uses one scan. Reading the drawing while you draw is free.
To draw on a phone or tablet instead, scan the QR code beside the pad with its camera, once. A drawing page opens in its browser, with nothing to install and no sign-in, and the phone stays paired with this Obsidian: across formulas, notes and restarts, until you unpair it. From then on, draw on the phone whenever Obsidian is open and tap Insert: the formula goes into the formula you're editing, or into your note at the cursor as a new one (with the Draw formula window open, into that window's formula, and you see it there as you draw). To get back to the drawing page later, open mathlive.danz.blog/draw on the phone, or add the page to its home screen. The page shows whether Obsidian is open; while it's closed, Insert waits and nothing is charged. Only the first browser to open a code can use it, and pairing a new phone replaces the one before. To pair a phone without opening Draw formula, or to unpair it, use Draw on your phone in MathLive's settings, or Unpair on the phone. With Self-hosted scanner on, the pad is read by your scanner and there is no QR code.
Open a PDF and click Convert to notes at its top right. You can also click ✨ in the left ribbon and pick Convert a PDF to notes, or right-click a PDF in the file list. Pick the pages you want and click Convert. MathLive reads the pages one by one into a new note next to the PDF: text as Markdown, formulas as $...$ and $$...$$ you can edit, and a link back to each page of the PDF. The note fills in as pages finish. You can close the window; MathLive tells you when it's done.
On the free plan each page uses one scan. Paid plans include a number of pages each month (500 on Monthly, 300 on Lifetime), and you can buy more pages when you need them. Blank pages and pages that can't be read are free. Before converting, MathLive shows how many pages you have left; if the PDF is longer, it converts the first pages that fit and you can get more pages for the rest. A page that can't be read gets a warning in the note, and Retry failed pages fills it in later. Your self-hosted scanner can do this too if it answers /pages/ the way the MathLive scanner does.
You can scan with either of these:
| Cloud scanner | Self-hosted scanner | |
|---|---|---|
| Setup | None for your first 3 scans. Then click Connect in Settings → MathLive (or when a scan asks), sign in with Google in your browser, and Obsidian connects by itself | Run a compatible server such as LaTeX-OCR, then turn on Self-hosted scanner |
| Cost | 3 trial scans, then 10 free scans per account and 5 more each month, or a paid plan for unlimited scans | Free |
| Best for | Most people | People already comfortable running local services |
The self-hosted scanner uses http://localhost:8502 unless you set another address in Self-hosted scanner address.
| Setting | What it does |
|---|---|
| Account | Connect or disconnect your MathLive account, see who you're connected as and how many scans are left |
| API key (Advanced) | Paste a key from your account page instead of connecting |
| Self-hosted scanner, Self-hosted scanner address (Advanced) | Send scans to your own server instead |
| Enable inline editor mode | Turn formulas in the note into editors |
| Enable inline / block math widgets | Choose which formulas get an editor |
| Hide rendered inline / block math | Show only the editor, without Obsidian's rendered math next to it |
| Update inline widgets immediately | Write changes into the note as you type, or when the formula loses focus |
| Arrow key navigation between editor and widgets | Move the cursor into and out of formulas with the arrow keys |
| Edit only the formula at the cursor | Keep formulas drawn like the rest of the note, and show the editor only for the formula with the cursor in it |
| Quick Latex shorthands, Your shorthands | Turn short letter codes into LaTeX when you press Space in a formula; import them from Quick Latex |
| Shorthands in typed LaTeX | Also expand shorthands in LaTeX typed between $ signs (Automatic: only when Quick Latex and Latex Suite are off) |
Obsidian asks plugins to state the following up front.
https://mathlive.danz.blog/ocr/trial gives a trial key on your first cloud scan when you have none.https://mathlive.danz.blog/ocr/predict/ receives the image you chose to scan, with your key, and returns LaTeX.https://mathlive.danz.blog/ocr/edit receives a formula you chose to Magic edit with your typed instruction or your voice recording, with your key, and returns the new formula.https://mathlive.danz.blog/ocr/pages/ receives a picture of each PDF page you chose to convert, with your key, and returns the page as Markdown.https://mathlive.danz.blog/ocr/draw/sessions with your key and sends each drawing there to be read. The QR code is made on your computer and links the phone to https://mathlive.danz.blog/draw/.... While a phone is paired, the plugin keeps one request open there at a time (from https://mathlive.danz.blog/ocr/draw/sessions/<id>/wait), so the phone's formulas reach you while Obsidian is open; unpair it to stop. The server keeps only fingerprints of the keys of a pairing, and the kind of phone (such as "iPhone"), never what you draw.https://mathlive.danz.blog/ocr/formulas/search receives what you type in Find a formula, without your key, and returns matching formulas. It always goes to MathLive's server, also with Self-hosted scanner on. The server keeps the text of searches that found nothing (without your key or address) for 180 days, to add the missing formulas.https://mathlive.danz.blog/ocr/formulas/write receives your search text, with your key, when you choose Write it with AI, and returns the formula. Claude by Anthropic writes it.https://mathlive.danz.blog/ocr/access-status is checked with your key to show your account, scans left, and pages left before converting a PDF.https://mathlive.danz.blog/connect in your browser with this device's name (your vault's name and operating system). While you approve, the plugin asks https://mathlive.danz.blog/ocr/connect/claim every 2 seconds for up to 10 minutes. Disconnecting tells https://mathlive.danz.blog/ocr/connect/forget to delete this device's key.Self-hosted scanner on, scans go to the address you set (by default http://localhost:8502) instead of MathLive's servers.Bug reports, ideas and pull requests are welcome. See CONTRIBUTING.md for how to report a bug or build the plugin locally, and SECURITY.md to report a security issue privately. Every change runs an automated test suite in a real Obsidian app.
If MathLive saves you time, a ⭐ on this repository helps other people find it, and you can buy me a coffee.
MIT © Dan Zilberman