https://github.com/amake/flutter_tex_js
A lightweight TeX plugin for Flutter via JavaScript
https://github.com/amake/flutter_tex_js
android flutter ios katex plugin tex
Last synced: about 1 month ago
JSON representation
A lightweight TeX plugin for Flutter via JavaScript
- Host: GitHub
- URL: https://github.com/amake/flutter_tex_js
- Owner: amake
- License: other
- Created: 2020-07-11T15:27:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-18T08:58:04.000Z (3 months ago)
- Last Synced: 2025-02-27T16:39:49.877Z (2 months ago)
- Topics: android, flutter, ios, katex, plugin, tex
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_tex_js
- Size: 2.26 MB
- Stars: 10
- Watchers: 3
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_tex_js
A lightweight TeX plugin for Flutter based on [KaTeX](https://katex.org/), a
popular and full-featured JavaScript TeX rendering library.
_flutter_tex_js used in [Orgro](https://orgro.org)_
_See a [demo video](https://twitter.com/amadlonkay/status/1285937038840131584?s=20)_
# What's different about this plugin?
As of July 2020, there are several other TeX packages/plugins for Flutter, but
most of them are either a) very heavyweight, relying on webview_flutter, or b)
very immature, with poor support for common TeX syntax.This plugin seeks a middle ground: It uses a single native webview under the
hood, in which it renders TeX markup to PNG. It then sends the PNG bytes back to
the Dart world where the result is displayed as an image.# Supported platforms
- Android 4.1 (SDK 16) and higher
- iOS 11 and higher*
- *You can include the plugin on iOS 9+, but it will only render on 11+. On
iOS 9 and 10, the `TexImage` widget will simply show the supplied text
as-is.# Setup
## Android
If your app uses Kotlin, make sure it is v1.3.60 or later (see
`ext.kotlin_version` in your `build.gradle` file). The default is v1.3.50, but
this has [known problems](https://github.com/amake/flutter_tex_js/issues/7), so
if you have never updated your Kotlin version then please do so.## iOS
No setup required.
# Usage
```dart
import 'package:flutter_tex_js/flutter_tex_js.dart';class MyMathWidget extends StatelessWidget {
Widget build(BuildContext context) {
return TexImage(r'a=\pm\sqrt{b^2+c^2} \int_\infty^\beta d\gamma');
}
}
```