{"id":24863683,"url":"https://github.com/makergyt/markdown-it-latex2img","last_synced_at":"2025-10-15T09:31:37.322Z","repository":{"id":57141007,"uuid":"254366931","full_name":"MakerGYT/markdown-it-latex2img","owner":"MakerGYT","description":"LaTex plugin for markdown-it markdown parser,Place LaTeX Math equation on anywhere as \u003cimg\u003e tag. ","archived":false,"fork":false,"pushed_at":"2020-07-02T09:51:24.000Z","size":30,"stargazers_count":39,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T20:40:02.612Z","etag":null,"topics":["hexo","katex","latex","markdown","markdown-it","markdown-it-plugin","markdown-parser","math","mathjax"],"latest_commit_sha":null,"homepage":"https://makergyt.github.io/markdown-it-latex2img/","language":"JavaScript","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/MakerGYT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://blog.makergyt.com/images/wechatpay.png"}},"created_at":"2020-04-09T12:36:23.000Z","updated_at":"2024-11-05T19:24:16.000Z","dependencies_parsed_at":"2022-09-04T22:10:39.922Z","dependency_job_id":null,"html_url":"https://github.com/MakerGYT/markdown-it-latex2img","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MakerGYT%2Fmarkdown-it-latex2img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MakerGYT%2Fmarkdown-it-latex2img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MakerGYT%2Fmarkdown-it-latex2img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MakerGYT%2Fmarkdown-it-latex2img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MakerGYT","download_url":"https://codeload.github.com/MakerGYT/markdown-it-latex2img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236600148,"owners_count":19175167,"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":["hexo","katex","latex","markdown","markdown-it","markdown-it-plugin","markdown-parser","math","mathjax"],"created_at":"2025-01-31T23:32:53.529Z","updated_at":"2025-10-15T09:31:37.012Z","avatar_url":"https://github.com/MakerGYT.png","language":"JavaScript","funding_links":["https://blog.makergyt.com/images/wechatpay.png"],"categories":[],"sub_categories":[],"readme":"# Markdown-it-latex2img\n[![Build Status](https://travis-ci.com/MakerGYT/markdown-it-latex2img.svg?branch=master)](https://travis-ci.com/MakerGYT/markdown-it-latex2img)\n[![NPM version](https://img.shields.io/npm/v/markdown-it-latex2img.svg?style=flat)](https://npmjs.com/package/markdown-it-latex2img)\n[![npm](https://img.shields.io/npm/dw/markdown-it-latex2img)](https://www.npmjs.com/package/markdown-it-latex2img)\n[![GitHub stars](https://img.shields.io/github/stars/MakerGYT/markdown-it-latex2img?style=social)](https://github.com/MakerGYT/markdown-it-latex2img/stargazers)\n\n\u003e LaTex plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser, Server side MathJax Renderer.\n\n## Background\n### Related\n- markdown-it-math:\nIt was originally designed to render MathML.\n- markdown-it-mathjax:\nJust to bypass LaTeX math for mathjax processing, need to import [mathjax](https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js)\n- markdown-it-katex:\nNeed to include the [KaTeX stylesheet](https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css)\n\n### Demand\n- Place LaTeX Math equation on anywhere\n- Accurate and fast, supports rendering of diverse formulas\n\n## Feature\n- Convert Latex syntax to image tags\n- Support inline and block formulas\n- Rendering results support multi-end use, such as WeChat Mini Program\n\n## Sample\n[Demo](https://makergyt.github.io/markdown-it-latex2img/)\n\n### Screenshot:\n\n![](https://imgkr.cn-bj.ufileos.com/307ef213-27ea-4908-a060-8616c2039dad.png)\n\n## Install\n### Node.js:\n```bash\nnpm install markdown-it-latex2img --save\n```\n### Browser (CDN):\n- [jsDeliver CDN](https://www.jsdelivr.com/package/npm/markdown-it-latex2img)\n\n## Usage\n### Node.js\n```js\nconst md = require('markdown-it')()\n            .use(require('markdown-it-latex2img'));\nmd.render(`$\\\\frac {a+1}{b+2}$`) //JavaScript strings require double backslashes, but HTML input and reading files are not required\n```\n### Browser\n_Differences in browser._ If you load script directly into the page, without package system, module will add itself globally as `window.markdownitLatex2img`.\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/markdown-it-latex2img@latest/dist/markdown-it-latex2img.min.js\" crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/markdown-it@11.0.0/dist/markdown-it.min.js\" crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  var md = window.markdownit();\n  md.use(window.markdownitLatex2img);\n\u003c/script\u003e\n```\n\n### Hexo\n`WARNING: No front-end scripts and other Math plugins are required. Remove them ALL before using this plugin.Please use official plugin hexo-renderer-markdown-it(plus) as Renderer.`\n\n1. Install\n```sh\nnpm i hexo-renderer-markdown-it --save\nnpm i markdown-it-latex2img --save\n```\n2. Config\n```yml\n# _config.yml\nmarkdown:\n  plugins:\n    - markdown-it-latex2img\n```\nDefault will load mathjax plugin EVERY PAGE during rendering,Does not reduce page speed after generated.Later will support on-demand rendering to improve rendering speed\n\n## Options(optional)\n|Property | Type | Default |Required | Remarks |\n|:--|:--|:--|:--|:--|\n|server|String| https://math.now.sh| true |?from=block/inline=inline |\n|style | String || false | commonly use `filter: opacity(75%);transform:scale(0.75);text-align:center;` to fit the body font color and size |\n\nIf you want to customize options in hexo,please do as follows:\n```yml\n# _config.yml\nmarkdown:\n  plugins:\n    - name: markdown-it-latex2img\n      options:\n        style: 'filter: opacity(90%);transform:scale(0.85);text-align:center;'\n```\n\n## Convention\nMarkup is based on [pandoc](https://pandoc.org/MANUAL.html#math) definition.\n[Mathjax](https://docs.mathjax.org/en/latest/basic/mathematics.html#tex-and-latex-input) pointed out\n\u003e The default math delimiters are $$...$$ and \\[...\\] for displayed mathematics, and \\(...\\) for in-line mathematics.Note in particular that the $...$ in-line delimiters are not used by default.That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly.\n\nHowever,most still use $...$, we have followed this habit.\n```sh\n# inline\n$\\frac {a+1}{b+2}$ # The opening $ must have a non-space character immediately to its right, while the closing $ must have a non-space character immediately to its left, and must not be followed immediately by a digit. \n```\n```sh\n# block\n$$\n{\ne^x=\\lim_{n\\to\\infty} \\left( 1+\\frac{x}{n} \\right)^n\n\\qquad (2) \n}\n$$\n```\n\n## Dependencies\n- [uetchy/math-api](https://github.com/uetchy/math-api)\n\n## Case\n- [Hexo blog](https://blog.makergyt.com/typography_en/)\n\n## License\n[MIT](https://github.com/MakerGYT/markdown-it-latex2img/blob/master/LICENSE) © MakerGYT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakergyt%2Fmarkdown-it-latex2img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakergyt%2Fmarkdown-it-latex2img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakergyt%2Fmarkdown-it-latex2img/lists"}