{"id":13615538,"url":"https://github.com/hexojs/hexo-math","last_synced_at":"2025-07-28T17:33:40.528Z","repository":{"id":14827868,"uuid":"17550628","full_name":"hexojs/hexo-math","owner":"hexojs","description":"A hexo plugin that uses MathJax to render math equations.","archived":false,"fork":false,"pushed_at":"2024-07-12T23:59:10.000Z","size":703,"stargazers_count":323,"open_issues_count":11,"forks_count":28,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-12T18:52:27.137Z","etag":null,"topics":["hexo","hexo-plugin"],"latest_commit_sha":null,"homepage":"","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/hexojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2014-03-08T20:47:52.000Z","updated_at":"2025-03-30T06:22:05.000Z","dependencies_parsed_at":"2024-01-17T00:18:24.101Z","dependency_job_id":"d58ecba1-2b3c-4bf7-97e0-f45235603146","html_url":"https://github.com/hexojs/hexo-math","commit_stats":{"total_commits":131,"total_committers":16,"mean_commits":8.1875,"dds":0.5343511450381679,"last_synced_commit":"a128269a76154dba5997e91b287466c6a30213f3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexojs","download_url":"https://codeload.github.com/hexojs/hexo-math/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248786121,"owners_count":21161400,"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","hexo-plugin"],"created_at":"2024-08-01T20:01:14.907Z","updated_at":"2025-04-13T21:31:00.979Z","avatar_url":"https://github.com/hexojs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# hexo-math\n\n[![Tester](https://github.com/hexojs/hexo-math/workflows/Tester/badge.svg?branch=master)](https://github.com/hexojs/hexo-math/actions?query=workflow%3ATester)\n[![npm version](https://badge.fury.io/js/hexo-math.svg)](https://www.npmjs.com/package/hexo-math)\n[![npm license](https://img.shields.io/npm/l/hexo-math)](./LICENSE)\n![npm download](https://img.shields.io/npm/dt/hexo-math)\n\nEmbed [KaTeX] and [MathJax] in [Hexo] post/page via tag plugins. Equations are rendered in Hexo (server-side), so browser-side javascript library is not needed and should be removed. CSS stylesheets are included by default but  can be easily replaced.\n\n## Installation\n\n```bash\n$ npm i hexo-math --save\n```\n\n- Requires Hexo 5+\n\n## Usage\n\n**KaTeX**\n\n```\n{% katex '{options}' %}\ncontent\n{% endkatex %}\n```\n\n### Examples\n\n```\n{% katex %}\nc = \\pm\\sqrt{a^2 + b^2}\n{% endkatex %}\n```\n\nOverride [front-matter](#per-article-configuration) and [global options](#global-options) for a particular content. Options must be specified in [JSON](https://en.wikipedia.org/wiki/JSON#Example) format.\n\n```\n{% katex '{ \"output\": \"mathml\", \"felqn\": true, \"minRuleThickness\": 0.05, \"throwOnError\": true }' %}\nc = \\pm\\sqrt{a^2 + b^2}\n{% endkatex %}\n```\n\n**MathJax**\n\n```\n{% mathjax '{options}' %}\ncontent\n{% endmathjax %}\n```\n\n### Examples\n\n```\n{% mathjax %}\n\\frac{1}{x^2-1}\n{% endmathjax %}\n```\n\nOverride [front-matter](#per-article-configuration) and [global options](#global-options) for a particular content. Options must be specified in [JSON](https://en.wikipedia.org/wiki/JSON#Example) format.\n\n```\n{% mathjax '{ \"conversion\": { \"em\": 14 }, \"tex\": { \"tags\": \"ams\" }, \"svg\": { \"exFactor\": 0.03 } }' %}\n\\frac{1}{x^2-1}\n{% endmathjax %}\n```\n\n## Per-article configuration\n\nOverride the global options via the front-matter of an article (post/page) basis.\n\n``` yml\n---\ntitle: On the Electrodynamics of Moving Bodies\ncategories: Physics\ndate: 1905-06-30 12:00:00\nkatex: false\nmathjax: false\n---\n```\n\n### Options\n\nDisable math renderer in an article:\n\n``` yml\n---\nkatex: false\nmathjax: false\n---\n```\n\nOverride global options:\n\n``` yml\n---\nkatex:\n  output: 'mathml'\n  felqn: true\n  minRuleThickness: 0.05\n  throwOnError: true\nmathjax:\n  conversion:\n    em: 14\n  tex:\n    tags: 'ams'\n  svg:\n    exFactor: 0.03\n---\n```\n\n## Global Options\n\n```yaml\n# _config.yml\nmath:\n  katex:\n    css: 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css'\n    options:\n      throwOnError: false\n  mathjax:\n    css: 'https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css'\n    options:\n      conversion:\n        display: false\n      tex:\n      svg:\n```\n\n- **css**: Location of stylesheet.\n  * Specify a relative path if you're self-hosting the stylesheet.\n    * Example: `css: '/css/style.css'` refers to `source/css/style.css` or `themes/\u003ctheme-name\u003e/source/css/style.css`.\n  * It can be disabled (`css: false`) if the installed theme has already included one.\n    * KaTeX: defaults to the [official stylesheet](https://github.com/KaTeX/KaTeX/blob/master/src/katex.less).\n    * MathJax: defaults to [style.css](dist/style.css)\n\n### KaTeX\n\n``` yaml\n  katex:\n    options:\n      throwOnError: false\n```\n\n- **options**: Refer to the [documentation](https://katex.org/docs/options.html) for available options.\n\n### MathJax\n\n``` yaml\n  mathjax:\n    options:\n      conversion:\n        display: false\n      tex:\n      svg:\n```\n\n- **options**: Rendering options.\n  * **conversion**: [Conversion options](https://docs.mathjax.org/en/latest/web/typeset.html#conversion-options).\n  * **tex**: [TeX input options](https://docs.mathjax.org/en/latest/options/input/tex.html).\n  * **svg**: [SVG output options](https://docs.mathjax.org/en/latest/options/output/svg.html).\n\n## Configuration priority\n\nUnique options are combined, if there is any duplicate options, [argument](#usage) overrides [front-matter](#per-article-configuration), front-matter overrides [global options](#global-options).\n\n**Example**:\n\n```\n{% katex '{ \"output\": \"html\", \"felqn\": true }' %}\ncontent\n{% endkatex %}\n```\n\n``` yml\n# front-matter\n---\nkatex:\n  output: 'mathml'\n  minRuleThickness: 0.05\n  throwOnError: true\n---\n```\n\n``` yml\n# _config.yml\nmath:\n  katex:\n    options:\n      minRuleThickness: 0.03\n      maxExpand: 900\n```\n\nFollowing options will be parsed as argument for that specific content:\n\n``` js\n{\n  output: 'html',\n  felqn: true,\n  minRuleThickness: 0.05,\n  throwOnError: true,\n  maxExpand: 900\n}\n```\n\n## Similar project\n\n- [hexo-filter-mathjax]: A MathJax plugin developed by @stevenjoezhang, who is also a Hexo developer. It enables you to write LaTeX in-line within your post without using a tag `{% %}`.\n  * hexo-math uses tag plugin approach due to minor incompatibility between LaTeX and [marked], the default markdown renderer of Hexo (via [hexo-renderer-marked]).\n\n[KaTex]: https://katex.org/\n[MathJax]: https://www.mathjax.org/\n[Hexo]: https://hexo.io/\n[hexo-filter-mathjax]: https://github.com/next-theme/hexo-filter-mathjax\n[marked]: https://github.com/markedjs/marked\n[hexo-renderer-marked]: https://github.com/hexojs/hexo-renderer-marked\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexojs%2Fhexo-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-math/lists"}