Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hansihe/texdroid

Android library for rendering and displaying TeX markup in UI.
https://github.com/hansihe/texdroid

Last synced: about 1 month ago
JSON representation

Android library for rendering and displaying TeX markup in UI.

Awesome Lists containing this project

README

        

TexDroid
========

Android library for rendering and displaying TeX markup in UI. It uses MathJax in a WebView running in a Service to render the TeX markup. Rendered markup is returned in the form of a fully self contained SVG file, in addition to the default pixel size of the equation. The data returned from the service can easily be passed into a TexEquationView to display, or used for other things.

The TexEquationView is backed by a WebView (javascript disabled for performance) with custom measuring code. When set to wrap\_content, the TexEquationView will automatically display the equation in a reasonable size. If the size is set manually, the equation will automatically scale to fill the availible space. By using the content\_scale attribute, you can multiply the equation size.

### Examples

test_layout.xml
```xml

```

```java
public class TexRenderTestActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test_layout);

final TexEquationView equationView = (TexEquationView) findViewById(R.id.texView);
equationView.renderEquation(this, new TexEquation("x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}"));
}
}
```