{"id":17095120,"url":"https://github.com/harunurhan/react-latex-next","last_synced_at":"2025-10-28T20:25:38.536Z","repository":{"id":39856821,"uuid":"143717218","full_name":"harunurhan/react-latex-next","owner":"harunurhan","description":"Render LaTeX in React apps","archived":false,"fork":false,"pushed_at":"2024-04-24T22:09:15.000Z","size":425,"stargazers_count":89,"open_issues_count":3,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T02:37:09.041Z","etag":null,"topics":["auto-render","katex","latex","react"],"latest_commit_sha":null,"homepage":"https://react-latex.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harunurhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-06T11:10:15.000Z","updated_at":"2024-10-23T17:50:16.000Z","dependencies_parsed_at":"2024-06-18T15:27:15.763Z","dependency_job_id":"c05f03a9-d36b-4f03-95c7-487ab9791788","html_url":"https://github.com/harunurhan/react-latex-next","commit_stats":{"total_commits":30,"total_committers":5,"mean_commits":6.0,"dds":"0.19999999999999996","last_synced_commit":"810b1da5193704a2c65093254f931f2fdef735a0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harunurhan%2Freact-latex-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harunurhan%2Freact-latex-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harunurhan%2Freact-latex-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harunurhan%2Freact-latex-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harunurhan","download_url":"https://codeload.github.com/harunurhan/react-latex-next/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"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":["auto-render","katex","latex","react"],"created_at":"2024-10-14T14:25:51.346Z","updated_at":"2025-10-28T20:25:33.496Z","avatar_url":"https://github.com/harunurhan.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-latex-next\n\n\u003e Render LaTeX beautifully in React apps!\n\n[![NPM](https://img.shields.io/npm/v/react-latex-next.svg)](https://www.npmjs.com/package/react-latex-next) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nIt renders all fragments of LaTeX (between delimiters) in a given text, similar to [KaTeX's auto-render](https://katex.org/docs/autorender.html).\n\nSee [the demo](https://react-latex.netlify.app).\n\n## Install\n\n```bash\nyarn add react-latex-next\n\nnpm install --save react-latex-next\n```\n\n## Usage\n\n```tsx\nimport 'katex/dist/katex.min.css';\nimport Latex from 'react-latex-next';\n\nfunction Example() {\n  return (\n    \u003cLatex\u003eWe give illustrations for the {1 + 2} processes $e^+e^-$, gluon-gluon and $\\\\gamma\\\\gamma \\\\to W t\\\\bar b$.\u003c/Latex\u003e\n  );\n}\n```\n\n**Note**: `katex` CSS needs to be included in your final bundle. Above example is using `import` to load `css` but depending on how the code \u0026 styles are built and bundled, it may be different for your case.\n\n### delimiters\n\nList of delimiters to look for math you can configure it via `delimiters` prop: `\u003cLatex delimiters={[...]}\u003e`\n\n#### A delimiter\n\n```js\n{\n  left: \"A string which starts the math expression (i.e. the left delimiter)\"\n  right: \"A string which ends the math expression (i.e. the right delimiter)\"\n  display: \"A boolean of whether the math in the expression should be rendered in display mode or not\"\n}\n```\n\n#### Default delimiters\n\n```js\n[\n  { left: '$$', right: '$$', display: true },\n  { left: '\\\\(', right: '\\\\)', display: false },\n  { left: '$', right: '$', display: false },\n  { left: '\\\\[', right: '\\\\]', display: true },\n]\n```\n\n### strict\n\nIt renders by default non-strict which means it falls back to raw text (without delimiters) in case of error.\nYou can enable strict mode like below, which will throw the error instead.\n\n```jsx\n\u003cLatex strict\u003e{textWithSomeBrokenLatex}\u003c/Latex\u003e\n```\n\n### macros\n\nA collection of custom macros. Each macro is a property with a name like `\\name` (written `\\\\name` in JavaScript) which maps to a string that describes the expansion of the macro.\n\n`macros` object is also used to persists macros defined in `LaTeX` via `\\gdef`, refer to the [KaTeX docs](https://katex.org/docs/api.html#persistent-macros) for more details (and security implications)\n\n```jsx\n\u003cLatex macros={{ \"\\\\f\": \"#1f(#2)\" }}\u003e{'$\\\\f\\\\relax{x} = x$ is rendered using macros'}\u003c/Latex\u003e\n```\n\n## License\n\nMIT © [harunurhan](https://github.com/harunurhan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharunurhan%2Freact-latex-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharunurhan%2Freact-latex-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharunurhan%2Freact-latex-next/lists"}