Skip to content

[Question] Support for LaTeX/Math formulas rendering #181

@aeroxr1

Description

@aeroxr1

Hi there!

First of all, thank you for this library; it's a great tool for handling rich text in Jetpack Compose.

I was wondering if there is currently any native support or a recommended approach for rendering LaTeX math formulas (e.g., via MathJax or KaTeX style syntax) within the RichText or Markdown components.

For example, I would like to parse and render strings containing standard delimiters like:
'''latex
$$f(x) = \int_{-\infty}^\infty \hat f(\xi),e^{2\pi i \xi x} ,d\xi$$
or inline math like $E = mc^2$
'''

Since the library relies on commonmark-java, is there a way to inject a specific extension for math handling? Alternatively, could the custom block rendering capabilities be leveraged to intercept these patterns and render a custom Composable (perhaps using a WebView or a Canvas-based math renderer)?

Any guidance, workaround, or future plans regarding this feature would be greatly appreciated.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions