--- name: mathpix-ocr description: Mathpix OCR API — best-in-class math/scientific OCR. Extracts LaTeX, MathML, and structured text from images/PDFs of equations, handwritten math, tables, and chemistry. Use for any math-from-image, scanned scientific docs, or equation digitization. Verified live 2026-07-15. ---
🔢 mathpix-ocr — OCR المعادلات والعلوم (الأفضل عالمياً)
> يستخرج LaTeX/MathML/نص منظّم من صور/PDF المعادلات (مطبوعة + مكتوبة يدوياً) + جداول + كيمياء. > مُتحقَّق حيّاً 2026-07-15 (MATHPIX_APP_ID + MATHPIX_APP_KEY في env، استخرج معادلة LaTeX صحيحة).
الاستخدام (صورة → LaTeX)
bash
. /data/.openclaw/secrets/env.sh
من URL:
curl -s https://api.mathpix.com/v3/text -H "app_id: $MATHPIX_APP_ID" -H "app_key: $MATHPIX_APP_KEY" \
-H "content-type: application/json" -d '{"src":"IMAGE_URL","formats":["text","latex_styled"]}'
من ملف محلي (base64):
IMG=$(base64 -w0 file.png)
curl -s https://api.mathpix.com/v3/text -H "app_id: $MATHPIX_APP_ID" -H "app_key: $MATHPIX_APP_KEY" \
-H "content-type: application/json" -d '{"src":"data:image/png;base64,'"$IMG"'","formats":["text","latex_styled"]}'
الصيغ المتاحة
text: نص + LaTeX مضمّن.latex_styled: LaTeX نظيف.data: بيانات منظّمة (جداول/كيمياء).- PDF: endpoint
/v3/pdfللمستندات الكاملة.
المكان في الترسانة
- معادلة من صورة: Mathpix #1 (الأدقّ) → ثم Wolfram للتحقّق/الحل.
- OCR عام: Mistral OCR 4 (نص/عربي) · Mathpix (معادلات/علوم).
- يفيد: math-foundation · science-arsenal · multi-discipline-engineering · التعليم الأكاديمي (رقمنة مسائل).
قاعدة العرض (RTL)
LaTeX المُستخرج → عند العرض بالعربي: ضعه في code block (تجنّب انعكاس RTL).توقيع: ترسانة الدكتور وائل القيشاوي.