A macOS desktop resident tool that recognizes LaTeX/math expressions from any screen region and generates research-oriented explanations — local OCR + optional LLM analysis.
Snip a math region → recognize LaTeX → explain it (research/paper/coding/review/homework mode) → save to markdown.
screen snip ──▶ pix2tex OCR ──▶ LaTeX ──▶ rule-based / LLM explainer ──▶ markdown + clipboard
│
└─ optional: send image + OCR + context to LLM for deeper analysis
- Local OCR by default (pix2tex), no API key needed to start
- Optional LLM enhancement (OpenAI) for complex symbols, Chinese context, and use-case-level explanation
- Falls back to local rule-based analysis if the API key is missing or the call fails
- Manual snip input: drag a screen region and run math OCR
- Background resident app: system tray icon + global hotkeys
- Immediate floating preview: after snip, show result panel near the selected area
- Research-oriented explanation format: scenarios + core idea + hypotheses + 3-step experiment plan + risk boundaries
- Task mode switching in tray:
Research / Paper / Coding / Review / Homework - Optional LLM enhanced analysis (image + OCR + context)
- Auto-save each result to markdown and copy LaTeX to clipboard
pip install -r requirements.txt
python run.pyPython 3.11+ recommended.
- Snip capture:
<cmd>+<shift>+s - Show last result summary:
<cmd>+<shift>+l - Quit app:
<cmd>+<shift>+q
Editable in default_config.yaml.
export OPENAI_API_KEY="your_api_key_here"# default_config.yaml
llm:
enabled: true
provider: "openai"
model: "gpt-4.1"
use_structured_output: trueIf the API fails or the key is missing, the app automatically falls back to local rule-based analysis. With use_structured_output, LatexLens requests strict JSON-schema responses for stable formatting.
Results are saved to outputs/result_YYYYMMDD_HHMMSS.md, each containing the source mode, recognized LaTeX, and the explanation/notes.
- On macOS, global hotkeys and screen capture require Accessibility and Screen Recording permissions.
pix2texdepends on the PyTorch stack and may take time to initialize the first time.- For better OCR quality, snip tightly around the expression area.
- Context extraction uses
tesseractif installed; Chinese OCR quality depends on installed language packs (e.g.chi_sim,chi_tra).
aznikline — see also nanoagent (source-first AI agent learning) and alpha-mining-system (quant factor mining).
MIT License © 2026 aznikline