chore(android): replace math engine with RaTeX#355
Open
eszlamczyk wants to merge 11 commits into
Open
Conversation
hryhoriiK97
reviewed
May 27, 2026
Collaborator
hryhoriiK97
left a comment
There was a problem hiding this comment.
LGTM! This is a great change 🙌 I've left a few comments - please take a look at them 🙏
6 tasks
hryhoriiK97
approved these changes
May 27, 2026
Collaborator
Author
|
Note, bumping |
Collaborator
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
Introduces new math engine -
RaTeX- replacingAndroid math.AndroidMath was unmaintained, required JitPack, and shipped
libc++_shared.sowhich caused duplicate native library conflicts in instrumentation builds (Detox). It also used reflection-heavy metric extraction for baseline alignment of inline math.What changed:
com.github.gregcockroft:AndroidMathforio.github.erweixin:ratex-android:0.1.9, removes theJitPackrepository, and removes the packaging { pickFirsts } workarounds that existed solely for AndroidMathconsumer-rules.pro- updates ProGuard keep rules fromcom.agog.mathdisplay.**/com.pvporbit.freetype.**toio.ratex.**MTMathView+ reflection-based ascent/descent extraction withRaTeXEngine.parseBlocking+RaTeXRendererdrawn to a Bitmap; removes the reflection companion entirelyCountDownLatch/main-threaddispatch (no longer needed since RaTeX is allegedly thread-safe); renamed frommeasureOnMainThreadtomeasureMTMathViewwith a lightweight inline View that renders synchronously viaRaTeXEngine.parseBlockingTesting
Start example app and try different markdown combinations via set markdown button (in playground - can be done one by one or via a combination):
Additionaly change
apps/example/src/screens/playground/PlaygroundScreeen.tsx'sMARKDOWN_STYLEfields (line 50) to includemathandinlineMathstylings, for example:PR Checklist