Skip to content
pubscout

flutter_tex_js

7.0.0, released 3 months ago by madlon-kay.com

Render TeX to PNG using KaTeX in a native WebView

WASM-readyUses material_ui
$ flutter pub add flutter_tex_js
Source repository

What it does

This plugin renders TeX markup to a PNG image via a lightweight native WebView and displays it as an image widget. It uses KaTeX for rendering and supports Android and iOS platforms.

AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display mathematical expressions in a Flutter app
  • You want a lightweight solution without pulling in the full webview_flutter dependency
  • You target Android 4.1+ and iOS 11+
  • You prefer PNG output for consistent sizing

Skip it when

  • You need support for iOS 9 or 10
  • You are using a Flutter version older than 3.47
  • You require dynamic HTML/CSS rendering instead of PNG

Strengths

  • Lightweight – only a single native WebView is used
  • Fast rendering via KaTeX
  • Supports both Android and iOS
  • No heavy dependencies

Weaknesses

  • Requires Flutter 3.47/Dart 3.13 or newer
  • iOS 11+ required for rendering
  • Limited to PNG output (no vector)
  • No support for older Flutter versions

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
4
import 'package:flutter_tex_js/flutter_tex_js.dart';

class MyMathWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TexImage(r'a=\pm\sqrt{b^2+c^2} \int_\infty^\beta d\gamma');
  }
}

Alternatives

Packages that do the same job and could replace flutter_tex_js.

Works with

Packages commonly used together with flutter_tex_js: ones it builds on, ones built on it, and its own family.