Skip to content
KaTeX View for android
Kotlin Java
Branch: master
Clone or download
Latest commit 8edf21d Feb 16, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app fixed issue with text color - #3, #4 Feb 16, 2020
gradle/wrapper initial commit Mar 14, 2019
katexview fixed issue with text color - #3, #4 Feb 16, 2020
.gitignore
LICENSE + MIT license Apr 6, 2019
README.md
build.gradle fixed issue with text color - #3, #4 Feb 16, 2020
dependencies.gradle fixed issue with text color - #3, #4 Feb 16, 2020
example.png * updated image Apr 5, 2019
gradle.properties initial commit Mar 14, 2019
gradlew
gradlew.bat initial commit Mar 14, 2019
settings.gradle

README.md

KaTeX View

Download license API

A library that uses Khan Academy KaTeX for TeX math rendering.

Usage

Gradle

Add this to your module's build.gradle file:

dependencies {
    // ... other dependencies
    implementation 'com.github.judemanutd:katexview:1.0.2'
}

Maven

<dependency>
  <groupId>com.github.judemanutd</groupId>
  <artifactId>katexview</artifactId>
  <version>1.0.2</version>
  <type>pom</type>
</dependency>

Include the following code in your xml layout

<com.judemanutd.katexview.KatexView
    android:id="@+id/katex_text"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:textColor="@color/colorPrimary" />

You can then supply the text to be rendered in kotlin or java

val text = "$$ c = \\pm\\sqrt{a^2 + b^2} $$"
katex_text.setText(text)

Supported Attributes

All webview attributes are automatically inherited, in addition to that, the following can be customized

  • color
    • can be specified in xml using the textColor attribute
    • can be used in code by calling the setTextColor on the KatexView
  • text size - coming soon
You can’t perform that action at this time.