Skip to content

Support for math blocks #2583

@swo

Description

@swo

Description

In a markdown file, math written inside $$...$$ and inside a GitHub-style math block ```math...``` should render the same way. It would be nice to have an easy way to do this.

Benefits

My organization writes a lot of math in markdown documents. Complex equations inside $...$ can render poorly in GitHub, in which case the more carefully fenced ```math...``` block works well. Ideally, we could have the same behavior when rendering documents using mkdocs, e.g.

Solution Idea

In https://github.com/CDCgov/cfa-ngm-widget/pull/94/files#diff-7cebb35a4fec30ee86113951068dd52ac56e61312925043481d7f9fd633ed107, I wrote a custom function that takes the content of the ```math...``` block and wraps it in $$ and an arithmatex span. This makes the html for equations written with $$...$$ and ```math...``` identical.

Is this the sort of function that belongs in this package, alongside pymdownx.superfences.fence_code_format that I use for mermaid diagrams?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions