{"id":15021271,"url":"https://github.com/remarkablemark/texsvg","last_synced_at":"2025-10-27T20:30:56.187Z","repository":{"id":37835195,"uuid":"260093696","full_name":"remarkablemark/texsvg","owner":"remarkablemark","description":"📐 TeX to SVG","archived":false,"fork":false,"pushed_at":"2024-10-29T23:04:24.000Z","size":2191,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-30T01:46:48.356Z","etag":null,"topics":["equation","formula","javascript","latex","math","mathjax","nodejs","npm","npm-package","package","svg","tex"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/texsvg","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remarkablemark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["remarkablemark"],"patreon":"remarkablemark","open_collective":null,"ko_fi":"remarkablemark","tidelift":null,"community_bridge":null,"liberapay":"remarkablemark","issuehunt":null,"otechie":null,"custom":["https://b.remarkabl.org/teespring"]}},"created_at":"2020-04-30T02:22:39.000Z","updated_at":"2024-10-29T23:04:26.000Z","dependencies_parsed_at":"2023-02-17T00:01:16.690Z","dependency_job_id":"ab9d2b7f-1f1b-4b24-a3cd-8bb3b7a4a263","html_url":"https://github.com/remarkablemark/texsvg","commit_stats":{"total_commits":707,"total_committers":5,"mean_commits":141.4,"dds":"0.18104667609618108","last_synced_commit":"d185a7f97123f3c0a1eb2d82e34ea26d93c639db"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Ftexsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Ftexsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Ftexsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Ftexsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkablemark","download_url":"https://codeload.github.com/remarkablemark/texsvg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238552986,"owners_count":19491352,"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":["equation","formula","javascript","latex","math","mathjax","nodejs","npm","npm-package","package","svg","tex"],"created_at":"2024-09-24T19:56:22.895Z","updated_at":"2025-10-27T20:30:56.177Z","avatar_url":"https://github.com/remarkablemark.png","language":"TypeScript","funding_links":["https://github.com/sponsors/remarkablemark","https://patreon.com/remarkablemark","https://ko-fi.com/remarkablemark","https://liberapay.com/remarkablemark","https://b.remarkabl.org/teespring"],"categories":[],"sub_categories":[],"readme":"# texsvg\n\n[![NPM](https://nodei.co/npm/texsvg.png)](https://nodei.co/npm/texsvg/)\n\n[![NPM version](https://img.shields.io/npm/v/texsvg.svg)](https://www.npmjs.com/package/texsvg)\n[![build](https://github.com/remarkablemark/texsvg/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/texsvg/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/remarkablemark/texsvg/branch/master/graph/badge.svg?token=BC34P2RTJB)](https://codecov.io/gh/remarkablemark/texsvg)\n\nConvert [TeX](https://wikipedia.org/wiki/TeX) to [SVG](https://wikipedia.org/wiki/Scalable_Vector_Graphics) using [MathJax](https://www.mathjax.org/) and [SVGO](https://github.com/svg/svgo):\n\n```\ntexsvg(string)\n```\n\n## Quick Start\n\nCLI:\n\n```sh\nnpx texsvg '\\frac{a}{b}' fraction.svg\n```\n\nScript:\n\n```js\nconst texsvg = require('texsvg');\n\ntexsvg('\\\\frac{a}{b}').then((svg) =\u003e console.log(svg));\n```\n\n## Installation\n\n### Module\n\n[NPM](https://www.npmjs.com/package/texsvg):\n\n```sh\nnpm install texsvg\n```\n\n[Yarn](https://yarnpkg.com/package/texsvg):\n\n```sh\nyarn add texsvg\n```\n\n### CLI\n\nNPM:\n\n```sh\nnpm install --global texsvg\n```\n\nYarn:\n\n```sh\nyarn global add texsvg\n```\n\nNPX:\n\n```sh\nnpx texsvg\n```\n\n## Usage\n\n### Module\n\nImport with ES Modules:\n\n```js\nimport texsvg from 'texsvg';\n```\n\nOr require with CommonJS:\n\n```js\nconst texsvg = require('texsvg');\n```\n\nConvert TeX to SVG using [async-await](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/async_function):\n\n```js\nconst quadraticFormula = 'x=\\\\frac{-b\\\\pm\\\\sqrt{b^2-4ac}}{2a}';\n\n(async () =\u003e {\n  try {\n    const svg = await texsvg(quadraticFormula);\n    console.log(svg);\n  } catch (err) {\n    console.error(err);\n  }\n})();\n```\n\nConvert TeX to SVG using [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise):\n\n```js\nconst quadraticFormula = 'x=\\\\frac{-b\\\\pm\\\\sqrt{b^2-4ac}}{2a}';\n\ntexsvg(quadraticFormula)\n  .then((svg) =\u003e console.log(svg))\n  .catch((err) =\u003e console.error(err));\n```\n\nConvert TeX to SVG without optimization:\n\n```js\ntexsvg('8', { optimize: false });\n```\n\n### CLI\n\nUsage:\n\n```sh\ntexsvg \u003ctex\u003e \u003cfile\u003e\n```\n\nConvert TeX to SVG and log result to console:\n\n```sh\ntexsvg '\\frac{a}{b}'\n```\n\nConvert TeX to SVG without optimization:\n\n```sh\ntexsvg '\\frac{a}{b}' --optimize=false\n```\n\nConvert TeX to SVG and save result to file:\n\n```sh\ntexsvg '\\frac{a}{b}' fraction.svg\n```\n\n## Testing\n\nRun tests with coverage:\n\n```sh\nnpm test\n```\n\nRun tests in watch mode:\n\n```sh\nnpm run test:watch\n```\n\nRun integration tests:\n\n```sh\nnpm run test:integration\n```\n\nLint files:\n\n```sh\nnpm run lint\nnpm run lint:tsc\n```\n\nFix lint errors:\n\n```sh\nnpm run lint:fix\n```\n\n## Examples\n\n- [StackBlitz (Script)](https://stackblitz.com/edit/texsvg)\n- [StackBlitz (Server)](https://stackblitz.com/edit/texsvg-server)\n- [texsvg-server](https://github.com/remarkablemark/texsvg-server)\n- [JSFiddle](https://jsfiddle.net/remarkablemark/1k7t6s9o/)\n\n## Release\n\nRelease is automated with [Release Please](https://github.com/googleapis/release-please).\n\n## License\n\n[MIT](https://github.com/remarkablemark/texsvg/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Ftexsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkablemark%2Ftexsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Ftexsvg/lists"}