|
1 | 1 | <div align="center"> |
2 | | - <img src="./src/assets/logo.svg" width="60" style="width: 60px;"/> |
3 | | - <p>MathFX</p> |
4 | | - <p><img src="https://img.shields.io/github/v/release/Creator-SN/MathFX" /></p> |
| 2 | + <img src="./src/renderer/src/assets/logo.svg" width="72" alt="MathFX logo" /> |
| 3 | + <h1>MathFX</h1> |
| 4 | + <p>A beautiful, friendly, and minimal formula OCR workspace powered by VLM APIs.</p> |
| 5 | + <p> |
| 6 | + <a href="https://github.com/Creator-SN/MathFX/releases"><img src="https://img.shields.io/github/v/release/Creator-SN/MathFX?label=release" alt="Latest release" /></a> |
| 7 | + <a href="https://github.com/Creator-SN/MathFX/actions/workflows/release.yml"><img src="https://github.com/Creator-SN/MathFX/actions/workflows/release.yml/badge.svg" alt="Release workflow" /></a> |
| 8 | + <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="MIT license" /></a> |
| 9 | + </p> |
| 10 | + <p><a href="./docs/README.zh-CN.md">中文文档</a></p> |
5 | 11 | </div> |
6 | 12 |
|
7 | | -<p align="center"> |
8 | | - <a href="LICENSE"> |
9 | | - <img src="https://img.shields.io/badge/License-MIT-yellow.svg"> |
10 | | - </a> |
11 | | -</p> |
| 13 | +## What is MathFX? |
12 | 14 |
|
13 | | -## 💡 MathFX(Preview) |
| 15 | +MathFX is a small cross-platform desktop tool for turning mathematical expressions into clean, editable LaTeX. Its core workflow is deliberately simple: capture a formula, let a vision-language model understand it, and copy the result wherever you need it. |
14 | 16 |
|
15 | | -A pure open source and cross platforms Math Formulates OCR tool based on the Electron. |
| 17 | +It is designed for papers, lecture notes, research workflows, and anyone who wants formula recognition without a crowded interface. |
16 | 18 |
|
17 | | -<div align="center" style="display: flex; justify-content: space-around;"> |
18 | | - <img src="./src/assets/docs/scan.png" width="320" style="width: 48%; box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.1);"/> |
19 | | - <img src="./src/assets/docs/scan_dark.png" width="320" style="width: 48%; box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.1);"/> |
| 19 | +<div align="center"> |
| 20 | + <img src="./src/renderer/src/assets/docs/scan.png" width="48%" alt="MathFX light interface" /> |
| 21 | + <img src="./src/renderer/src/assets/docs/scan_dark.png" width="48%" alt="MathFX dark interface" /> |
20 | 22 | </div> |
21 | 23 |
|
22 | | -## 🎈 Platform |
23 | | - |
24 | | -- ✔ Windows 11 [Supported] |
25 | | -- ✔ Windows 10 [Supported] |
26 | | -- ✔ Mac(AMD64) [Supported] |
| 24 | +## Highlights |
27 | 25 |
|
| 26 | +- **Minimal formula OCR** — capture a formula from any screen with a global shortcut and receive editable LaTeX. |
| 27 | +- **VLM API based** — use a vision-capable, OpenAI-compatible Chat API instead of being locked to a single OCR vendor. |
| 28 | +- **Your provider, your model** — configure a custom display name, base URL, API key, model, and `reasoning_effort` (defaults to `medium`). |
| 29 | +- **LangGraph orchestration** — the recognition request is represented as a small LangGraph workflow, making the model call and result parsing explicit and extensible. |
| 30 | +- **Manual LaTeX workspace** — edit or enter LaTeX by hand, render it immediately, and keep the corrected result in history. |
| 31 | +- **Copy in useful formats** — quickly copy bare LaTeX, inline math, display math, equation-environment LaTeX, rendered SVG, or a raster image for documents and desktop applications. |
| 32 | +- **History and navigation** — keep recognized formulas locally, browse previous results, edit them, and remove entries when they are no longer needed. |
| 33 | +- **Light and dark themes** — a compact interface that stays out of the way while you work. |
| 34 | +- **Windows and macOS releases** — packaged installers are built automatically through GitHub Actions. |
28 | 35 |
|
29 | | -## ✨ Installation |
| 36 | +## How recognition works |
30 | 37 |
|
31 | | -See the [Release Page](https://github.com/Creator-SN/MathFX/releases). |
| 38 | +MathFX sends the captured image to the VLM endpoint configured in the selected subscription. The model is instructed to return one JSON object containing KaTeX-compatible LaTeX. MathFX then parses the response and performs rendering, SVG generation, format conversion, and clipboard operations locally. |
32 | 39 |
|
33 | | -## 🔨 Tutorial |
| 40 | +The default prompt asks the model to preserve fractions, roots, matrices, Greek letters, limits, superscripts, subscripts, aligned equations, operators, and visible text while returning no Markdown or explanation. |
34 | 41 |
|
35 | | -First, you need to set up the subscriptions, MathFX currently supports three formulate OCR APIs. Including: |
| 42 | +Because MathFX uses a VLM API, the selected model must support image input. The endpoint should be compatible with the OpenAI Chat Completions interface, including hosted OpenAI-compatible services and local vision models. |
36 | 43 |
|
37 | | -1. **SLatex OCR** **(Recommend)**: To build your own backend server, you can deploy the OCR server in this repo [SLatexOCR](https://github.com/aleversn/sLatexOCR). |
38 | | -2. **Mathpix**: You can register the OCR API services with `$1` started, and the current pricing is much cheaper than directly using the Mathpix desktop application, each month you can have a `1,000` free requests. (`Although it costs $1 to sign up and a Credit Card is necessary, but the performance of this API is currently the best`). [See Details](https://mathpix.com/ocr) |
39 | | -3. **Xunfei** Formula Recognition API: You can register the OCR API for free and obtain a `500` requests per day. [See Details](https://www.xfyun.cn/service/formula-discern) |
40 | | -4. **Baidu** Formula Recognition API: You can register the OCR API for free and obtain a `1,000` requests per month. [See Details](https://ai.baidu.com/tech/ocr/formula) |
| 44 | +> Images are sent to the API provider configured by you. Review that provider's privacy and retention policy before using sensitive material. |
41 | 45 |
|
42 | | -> Note that the performance of `Xunfei` and `Baidu` OCR API is not good in complex science formulates scenes. |
| 46 | +## Quick start |
43 | 47 |
|
44 | | -Once you have an OCR API subscription, all you need to do is fill in the necessary information about the current subscription. Then click this subscription's item block until the block's border is `blue`. |
| 48 | +1. Download the latest installer from the [Releases page](https://github.com/Creator-SN/MathFX/releases). |
| 49 | +2. Open **Subscriptions** and add a Chat API subscription. |
| 50 | +3. Fill in the name, base URL, API key, vision-capable model, and optional `reasoning_effort` (`medium` by default). |
| 51 | +4. Select the subscription so its active state is highlighted. |
| 52 | +5. Press the scan button or use `Alt + Shift + X` on Windows, or `Alt + Cmd + X` on macOS. |
45 | 53 |
|
46 | 54 | <div align="center"> |
47 | | - <img src="./src/assets/docs/subscription.png" style="width: 80%; box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.1);"/> |
| 55 | + <img src="./src/renderer/src/assets/docs/subscription.png" width="80%" alt="MathFX subscription settings" /> |
48 | 56 | </div> |
49 | 57 |
|
50 | | -Now you can scan for a new formulate scene on the `Scan` page or press `Alt + Shift/Cmd + X` to quick scan. |
| 58 | +## Editing and copying formulas |
51 | 59 |
|
52 | | -## ⌨ Shortcuts |
| 60 | +After recognition, the formula can be corrected manually. MathFX renders the edited LaTeX with KaTeX and lets you copy the result in the format that fits the destination: |
53 | 61 |
|
54 | | -- `Alt` + `Shift/Cmd` + `M`: Show the main program. |
55 | | -- `Alt` + `Shift/Cmd` + `X`: Start a new quick scan. |
| 62 | +- plain LaTeX source for editors such as VS Code; |
| 63 | +- inline or display LaTeX for Markdown and documentation; |
| 64 | +- an equation environment for LaTeX documents; |
| 65 | +- rendered SVG for Word and other rich document applications; |
| 66 | +- an image for applications that accept bitmap content. |
56 | 67 |
|
57 | | -## 🌏 Language |
| 68 | +The formula and its source image are kept in the local history store so you can revisit, edit, copy, or delete them later. |
58 | 69 |
|
59 | | -Currently supports two languages. |
| 70 | +## Keyboard shortcuts |
60 | 71 |
|
61 | | -- English |
62 | | -- 简体中文(Chinese) |
| 72 | +- `Alt + Shift + X` on Windows / `Alt + Cmd + X` on macOS — capture a new formula. |
63 | 73 |
|
64 | | -## Acknowledgements |
| 74 | +## Development |
65 | 75 |
|
66 | | -This Project is Develop Based on [VFluentForElectron](https://github.com/Creator-SN/VFluentForElectron). |
| 76 | +Requirements: Node.js 20+, Yarn 1.x, and a VLM API key for end-to-end recognition. |
67 | 77 |
|
68 | | -## License |
| 78 | +```bash |
| 79 | +yarn install |
| 80 | +yarn dev |
| 81 | +``` |
| 82 | + |
| 83 | +Build the renderer and Electron bundles: |
| 84 | + |
| 85 | +```bash |
| 86 | +yarn build |
| 87 | +``` |
69 | 88 |
|
70 | | -MIT License |
| 89 | +Build platform packages locally: |
71 | 90 |
|
72 | | -Copyright (c) 2024 Creator SN® |
| 91 | +```bash |
| 92 | +yarn build:win |
| 93 | +yarn build:mac |
| 94 | +``` |
73 | 95 |
|
74 | | -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
| 96 | +Tagged pushes matching `v*` trigger the GitHub Actions release workflow. Windows produces an NSIS installer; macOS produces DMG and ZIP packages using `Icon.icns`. |
75 | 97 |
|
76 | | -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| 98 | +## Architecture |
| 99 | + |
| 100 | +- **Electron + Vue 3** — desktop shell and renderer UI. |
| 101 | +- **Vite / electron-vite** — development and production bundling. |
| 102 | +- **LangChain OpenAI + LangGraph** — VLM model integration and recognition graph. |
| 103 | +- **KaTeX** — local LaTeX rendering. |
| 104 | +- **Pinia + lowdb** — application state and local history/subscription persistence. |
| 105 | +- **VFluent 3** — compact Fluent-inspired UI components. |
| 106 | + |
| 107 | +## Acknowledgements |
| 108 | + |
| 109 | +MathFX is built with [VFluent 3](https://github.com/Creator-SN/VFluentForElectron) and the Electron ecosystem. |
| 110 | + |
| 111 | +## License |
77 | 112 |
|
78 | | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 113 | +MathFX is released under the [MIT License](LICENSE). |
0 commit comments