noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.68k stars 298 forks source link

Arabic latex support #412

Closed AzharRagab closed 1 year ago

AzharRagab commented 1 year ago

I am using JLatexMathPlugin to display math formula it works well in english equation but when i want to display Arabic equation The Arabic letters appears well, but the numbers still appears in English.

FYI: the Arabic number is displayed well in Markwon without latex plugin but when using JLatexMathPlugin the arabic number doesn't display in Arabic.

Below is the code i used

 Markwon.builder(context) // required plugin to support inline parsing
                .usePlugin(MarkwonInlineParserPlugin.create())
                .usePlugin(HtmlPlugin.create()) // support html
                .usePlugin(JLatexMathPlugin.create(textSize) { builder -> // ENABLE inlines
                    builder.inlinesEnabled(true)
                })
                .usePlugin(SoftBreakAddsNewLinePlugin.create()) // to add new line
                .build()

Screenshot of how it looks like with english equation.

Screen Shot 2022-08-18 at 5 35 49 PM

Screenshot of how it looks like with arabic equation.

Screen Shot

any solution for this @noties ?

noties commented 1 year ago

Hello @AzharRagab ,

I'm not really versed in Arabic and do not know how it is rendered in LaTeX. But it appears that you should be able to achieve that by manually specifying text for the power values, like this:

2^{2} + 3^{yep}

=

2^{2} + 3^{yep}