Skip to content

derysudrajat/math-view

Repository files navigation

math-view

math-view

A Library for displaying math equation in Android

Setup

Add this to build.gradle (project)

allprojects {
  repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
}

Add this dependency to build.grdle (module) or if you using gradle 7+ put it to setting.gradle

dependencies {
  implementation 'com.github.derysudrajat:math-view:1.0.1'
}

How to use

Create MathView in your XML layout

<io.github.derysudrajat.mathview.MathView
  android:id="@+id/mathView"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"/>

You can put LaTeX expression to set into the formula

val formula = "2a+4b\\sqrt{\\frac{4x-2^{6}}{ax^2+57}}+\\frac{3}{2}"
mathView.formula = formula

Screenshot

Sample App