/MathView

One stop for all Math formula and Chemical equation rendering in Android

Primary LanguageJavaApache License 2.0Apache-2.0

Build Status

MathView

✔️ Support all types of math encoding ( MathML, TeX or AsciiMath etc) and chemical formulas.

✔️ Offline capability.

✔️ Lightweight (~150kb).

✔️ Fast rendering.

✔️ Easy to use.

✔️ Sample code MainActivity.java

Demo

Demo Url

Configured delimiters

  • TeX, inline mode: \(...\) or $...$
  • TeX, display mode: \[...\] or $$...$$
  • Asciimath: \`...\`

Installation

Add below lines to app's build.gradle

repositories {
  maven { url 'https://jitpack.io' }
}
dependencies {
  compile 'com.github.Nishant-Pathak:MathView:v1.1'
}

Usage

###In your layout:

    <com.nishant.math.MathView
        android:id="@+id/math_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

###In Activity:

  @BindView(R.id.math_view)
  MathView mathView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ...
    // update the view as below
    mathView.setText("`2+3 = 5`")
  }

###Proguard-rules:


-keepattributes EnclosingMethod
-keep class com.nishant.** { *; }

Sponsership

Thank you for your interest in the project. If you find it useful, please contribute here to keep the development on

Sponser

License

Copyright (C) 2016 - 2022 Nishant Pathak

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.