{"id":16695150,"url":"https://github.com/mitya57/python-markdown-math","last_synced_at":"2025-04-05T00:07:37.571Z","repository":{"id":25700064,"uuid":"29136472","full_name":"mitya57/python-markdown-math","owner":"mitya57","description":"Math extension for Python-Markdown","archived":false,"fork":false,"pushed_at":"2022-08-12T10:58:05.000Z","size":61,"stargazers_count":123,"open_issues_count":2,"forks_count":27,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T23:05:58.759Z","etag":null,"topics":["markdown","math","mathjax","python-markdown"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/python-markdown-math/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitya57.png","metadata":{"files":{"readme":"README.md","changelog":"changelog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T13:25:03.000Z","updated_at":"2025-02-14T00:22:38.000Z","dependencies_parsed_at":"2022-07-10T13:00:23.497Z","dependency_job_id":null,"html_url":"https://github.com/mitya57/python-markdown-math","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitya57%2Fpython-markdown-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitya57%2Fpython-markdown-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitya57%2Fpython-markdown-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitya57%2Fpython-markdown-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitya57","download_url":"https://codeload.github.com/mitya57/python-markdown-math/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266563,"owners_count":20910836,"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":["markdown","math","mathjax","python-markdown"],"created_at":"2024-10-12T17:05:38.656Z","updated_at":"2025-04-05T00:07:37.552Z","avatar_url":"https://github.com/mitya57.png","language":"Python","readme":"[![Travis CI status](https://api.travis-ci.org/mitya57/python-markdown-math.svg)][Travis]\n\n[Travis]: https://travis-ci.org/mitya57/python-markdown-math\n\nMath extension for Python-Markdown\n==================================\n\nThis extension adds math formulas support to [Python-Markdown].\n\n[Python-Markdown]: https://github.com/Python-Markdown/markdown\n\nInstallation\n------------\n\n### Install from PyPI\n\n```\n$ pip install python-markdown-math\n```\n\n### Install locally\n\nUse `setup.py build` and `setup.py install` to build and install this\nextension, respectively.\n\nThe extension name is `mdx_math`, so you need to add that name to your\nlist of Python-Markdown extensions.\nCheck [Python-Markdown documentation] for details on how to load\nextensions.\n\n[Python-Markdown documentation]: https://python-markdown.github.io/reference/#extensions\n\nUsage\n-----\n\nTo use this extension, you need to include [MathJax] library in HTML files, like:\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js\"\u003e\n\u003c/script\u003e\n```\n\n[MathJax]: https://www.mathjax.org/\n\nAlso, you need to specify a configuration for MathJax. Please note that\nmost of standard configurations include `tex2jax` extension, which is not needed\nwith this code.\n\nExample of configuration for MathJax 2.x:\n\n```html\n\u003cscript type=\"text/x-mathjax-config\"\u003e\nMathJax.Hub.Config({\n  config: [\"MMLorHTML.js\"],\n  jax: [\"input/TeX\", \"output/HTML-CSS\", \"output/NativeMML\"],\n  extensions: [\"MathMenu.js\", \"MathZoom.js\"]\n});\n\u003c/script\u003e\n```\n\nIf you want to use MathJax 3.x, you need to teach it to understand 2.x-style\n`\u003cscript\u003e` tags. See the [upgrading documentation] on how to do it.\nAlternatively, you may use the [Arithmatex] extension which has a generic\noutput mode, that does not require such special configuration.\n\nTo pass the extension to Python-Markdown, use `mdx_math` as extension name.\nFor example:\n\n```python\n\u003e\u003e\u003e md = markdown.Markdown(extensions=['mdx_math'])\n\u003e\u003e\u003e md.convert('$$e^x$$')\n'\u003cp\u003e\\n\u003cscript type=\"math/tex; mode=display\"\u003ee^x\u003c/script\u003e\\n\u003c/p\u003e'\n```\n\nUsage from the command line:\n\n```\n$ echo \"\\(e^x\\)\" | python3 -m markdown -x mdx_math\n\u003cp\u003e\n\u003cscript type=\"math/tex\"\u003ee^x\u003c/script\u003e\n\u003c/p\u003e\n```\n\n[upgrading documentation]: https://docs.mathjax.org/en/latest/upgrading/v2.html#math-script-example\n[Arithmatex]: https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/\n\nMath Delimiters\n---------------\n\nFor inline math, use `\\(...\\)`.\n\nFor standalone math, use `$$...$$`, `\\[...\\]` or `\\begin...\\end`.\n\nThe single-dollar delimiter (`$...$`) for inline math is disabled by\ndefault, but can be enabled by passing `enable_dollar_delimiter=True`\nin the extension configuration.\n\nIf you want to use [GitLab-style delimiters] (``$`...`$`` for inline math,\nand a code block-like `` ```math...``` `` syntax for standalone), use\n`use_gitlab_delimiters=True` configuration option.\n\nIf you want to this extension to generate a preview node (which will be shown\nwhen MathJax has not yet processed the node, or when JavaScript is unavailable),\nuse `add_preview=True` configuration option.\n\n[GitLab-style delimiters]: https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#math\n\nNotes\n-----\n\nIf you use [ReText](https://github.com/retext-project/retext), this extension\nis not needed as it is included by default.\n\nThis extension also works with Katex.  Use the following in your page `\u003chead\u003e`:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css\" crossorigin=\"anonymous\"\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js\" crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/katex/dist/contrib/mathtex-script-type.min.js\" defer\u003e\u003c/script\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitya57%2Fpython-markdown-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitya57%2Fpython-markdown-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitya57%2Fpython-markdown-math/lists"}