{"id":26542259,"url":"https://github.com/tiny-md/latex-math","last_synced_at":"2026-04-13T05:32:55.811Z","repository":{"id":283706848,"uuid":"952546873","full_name":"tiny-md/latex-math","owner":"tiny-md","description":"A utility for parsing LaTeX math into abstract syntax trees.","archived":false,"fork":false,"pushed_at":"2025-03-21T17:42:56.000Z","size":303,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T17:54:24.696Z","etag":null,"topics":["javascript","latex","latex-ma","markdow","mayank1513","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiny-md.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["tiny-md","mayank1513"],"polar":"mayank1513","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://pages.razorpay.com/mayank1513"]}},"created_at":"2025-03-21T13:12:45.000Z","updated_at":"2025-03-21T17:43:00.000Z","dependencies_parsed_at":"2025-03-21T17:54:44.539Z","dependency_job_id":"cc542c0e-3a47-4bea-80c6-35b80ac41eb8","html_url":"https://github.com/tiny-md/latex-math","commit_stats":null,"previous_names":["tiny-md/latex-math"],"tags_count":1,"template":false,"template_full_name":"react18-tools/turborepo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-md%2Flatex-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-md%2Flatex-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-md%2Flatex-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-md%2Flatex-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiny-md","download_url":"https://codeload.github.com/tiny-md/latex-math/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894308,"owners_count":20527678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","latex","latex-ma","markdow","mayank1513","nodejs","typescript"],"created_at":"2025-03-22T02:15:37.109Z","updated_at":"2025-12-30T23:54:06.196Z","avatar_url":"https://github.com/tiny-md.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tiny-md","https://github.com/sponsors/mayank1513","https://polar.sh/mayank1513","https://pages.razorpay.com/mayank1513"],"categories":[],"sub_categories":[],"readme":"# LaTeX Math to AST \u003cimg src=\"https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png\" style=\"height: 40px\"/\u003e\n\n[![test](https://github.com/tiny-md/latex-math/actions/workflows/test.yml/badge.svg)](https://github.com/tiny-md/latex-math/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/tiny-md/latex-math/maintainability) [![codecov](https://codecov.io/gh/tiny-md/latex-math/graph/badge.svg)](https://codecov.io/gh/tiny-md/latex-math) [![Version](https://img.shields.io/npm/v/latex-math.svg?colorB=green)](https://www.npmjs.com/package/latex-math) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/latex-math.svg)](https://www.npmjs.com/package/latex-math) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/latex-math) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)\n\n\u003e Convert LaTeX math strings into structured abstract syntax trees (ASTs) — lightweight, Vite-compatible, and built for modern tooling.\n\n---\n\n## ✨ Overview\n\nThis utility parses **LaTeX math strings** and transforms them into **LaTeX ASTs** for further processing, analysis, or transformation.\n\nIt is a **trimmed-down version of [`@unified-latex/unified-latex-util-parse`](https://www.npmjs.com/package/@unified-latex/unified-latex-util-parse)**, built specifically to address compatibility issues with **Vite** and modern build tools.\n\n---\n\n## 🚀 Features\n\n- 🧠 Converts LaTeX math strings to ASTs\n- ⚡️ Lightweight \u0026 minimal dependencies\n- 🛠 Vite-compatible (unlike `@unified-latex/unified-latex-util-parse`)\n- 🔌 Easy to integrate with `remark-math` pipelines\n- 📦 Suitable for client-side or server-side rendering\n\n---\n\n### Installation\n\n```bash\npnpm add latex-math\n```\n\n**_or_**\n\n```bash\nnpm install latex-math\n```\n\n**_or_**\n\n```bash\nyarn add latex-math\n```\n\n---\n\n## 🔧 Usage\n\n```ts\nimport { parseMath } from \"latex-math\";\n\nconst latex = \"\\\\frac{a}{b}\";\nconst ast = parseMath(latex);\n\nconsole.log(ast);\n```\n\n---\n\n## 📚 Why this exists\n\nThe original package [`@unified-latex/unified-latex-util-parse`](https://github.com/unified-latex/unified-latex) is robust, but includes many dependencies and causes issues in **Vite-based** or **modern ESM** projects.\n\nThis package solves that by providing only what's necessary to parse **math-mode LaTeX**, with modern compatibility and minimal footprint.\n\n---\n\n\u003e \u003cimg src=\"https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png\" style=\"height: 20px\"/\u003e Star [this repository](https://github.com/tiny-md/latex-math) and share it with your friends.\n\n## 📄 License\n\nThis library is licensed under the MPL-2.0 open-source license.\n\n\u003e \u003cimg src=\"https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png\" style=\"height: 20px\"/\u003e Please enroll in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsor](https://github.com/sponsors/mayank1513) our work.\n\n\u003chr /\u003e\n\n\u003cp align=\"center\" style=\"text-align:center\"\u003ewith 💖 by \u003ca href=\"https://mayank-chaudhari.vercel.app\" target=\"_blank\"\u003eMayank Kumar Chaudhari\u003c/a\u003e\u003c/p\u003e\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-md%2Flatex-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiny-md%2Flatex-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-md%2Flatex-math/lists"}