{"id":20079591,"url":"https://github.com/transpect/unwrap-mml","last_synced_at":"2026-02-15T06:32:16.260Z","repository":{"id":93859612,"uuid":"99341774","full_name":"transpect/unwrap-mml","owner":"transpect","description":"Library to convert simple MathML equations to XML/plaintext","archived":false,"fork":false,"pushed_at":"2024-01-06T15:18:30.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T21:18:19.561Z","etag":null,"topics":["mathml"],"latest_commit_sha":null,"homepage":"","language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transpect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-08-04T12:42:03.000Z","updated_at":"2024-09-19T13:17:47.000Z","dependencies_parsed_at":"2024-11-13T15:36:07.283Z","dependency_job_id":null,"html_url":"https://github.com/transpect/unwrap-mml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/transpect/unwrap-mml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Funwrap-mml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Funwrap-mml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Funwrap-mml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Funwrap-mml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transpect","download_url":"https://codeload.github.com/transpect/unwrap-mml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transpect%2Funwrap-mml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29471941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T05:26:30.465Z","status":"ssl_error","status_checked_at":"2026-02-15T05:26:21.858Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mathml"],"created_at":"2024-11-13T15:23:32.439Z","updated_at":"2026-02-15T06:32:16.241Z","avatar_url":"https://github.com/transpect.png","language":"XSLT","readme":"# unwrap-mml\nLibrary to convert simple MathML equations to XML/plaintext\n\n## Description\n\nBesides LaTeX, MathML is in most cases the preferred format for the markup\nof math equations. However, simple equations and formula symbols do not\nnecessarily need to be presented as MathML. In certain scenarios, it's more\nconvenient to render the equations as plain text, for example to accelerate the\nrendering of the document, to decrease file size or to bypass lacking MathML\nsupport in some reading systems (poor you!).\n\n## How it works\n\nCommon math styles (bold, italic, bold-italic) and superscripts and subscripts are\ntagged with the appriopriate elements of the document XML schema. Letters in other\nstyles (e.g. double-struck, fraktur, script) are mapped to their Unicode equivalent.\n\n```xml\n\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\n  \u003cmsup\u003e\n    \u003cmi\u003ex\u003c/mi\u003e\n    \u003cmn\u003e2\u003c/mn\u003e\n  \u003c/msup\u003e\n\u003c/math\u003e\n```\n\nThe expression above converted to XHTML:\n\n\n```xml\n\u003ci\u003ex\u003c/i\u003e\u003csup\u003e2\u003c/sup\u003e\n```\n\nYou can find the full examples [here](https://github.com/transpect/unwrap-mml/blob/master/example).\n\n## Configuration\n\nCreate an XSLT stylesheet and import `xsl/unwrap-mml.xsl`.\n\n```xml\n\u003cxsl:import href=\"unwrap-mml.xsl\"/\u003e\n```\n\nOverride the following parameters (XSD type: _element()_) to create appropriate\nwrapper elements for your target XML grammar:\n\n* wrapper (wrapper for the entire equation)\n* superscript\n* subscript\n* bold\n* italic\n* bold-italic\n\nHere is an example on how to configure that MathML superscripts are replaced\nwith DocBook superscripts:\n\n```xml\n\u003cxsl:param name=\"superscript\" as=\"element()\"\u003e\n  \u003csuperscript xmlns=\"http://docbook.org/ns/docbook\"/\u003e\n\u003c/xsl:param\u003e\n```\n\nNote: If you want to convert MathML to pure plaintext, just declare all parameters as empty.\n\nUse the function _tr:unwrap-mml-boolean()_ as condition in your template\nto determine whether the MathML can be unwrapped or not. Apply subsequent\ntemplates in the XSLT mode `unwrap-mml`.\n\n```xml\n\u003cxsl:template match=\"*:inlineequation[mml:math[tr:unwrap-mml-boolean(.)]]\"\u003e\n  \u003cxsl:apply-templates mode=\"unwrap-mml\"/\u003e\n\u003c/xsl:template\u003e\n```\n\nYou can configure at which size an equation won't be unwrapped. Therefore, you\ncan set a limit for the maximum numbers of operators. If an equation has more\noperators than the operator limit, it won't be unwrapped. Please note that the\noperator limit represents `\u003cmo\u003e`s except those which contain parentheses or\njust whitespace.\n\n```xml\n\u003cxsl:param name=\"operator-limit\" select=\"1\" as=\"xs:integer\"/\u003e\n```\n\nNote: unwrap-mml requires that MathML comes with the namespace URI\n`http://www.w3.org/1998/Math/MathML`. If this is not the case, you must attach\nthe namespace first and then invoke unwrap-mml. You can find an example\nin `xsl/unwrap-mml-aplusplus.xsl`\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranspect%2Funwrap-mml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftranspect%2Funwrap-mml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranspect%2Funwrap-mml/lists"}