r/FlutterDev•
amake

New plugin: flutter_tex_js, a lightweight AND full-featured LaTeX rendering plugin for iOS, Android

Plugin

I recently released flutter_tex_js, a new LaTeX rendering plugin supporting iOS and Android.

There are already a few LaTeX plugins out there, so why make a new one?

Existing plugins all seem to either be a) very heavyweight, embedding an entire webview per text run, or b) very immature, not yet supporting a wide variety of LaTeX syntax.

flutter_tex_js strikes a balance by using what seems to be a somewhat novel approach:

  1. Render on a single native webview
  2. Capture the result as PNG bytes
  3. Send bytes back to Dart for display as an image

The result is performant and has good syntax support (thanks to KaTeX, the underlying JavaScript rendering library).

See also a demo video with a comparison to existing packages. The thread also has some more of the story of how I came to create this plugin.

I am using the plugin in production right now in my app Orgro, an org-mode file viewer for iOS and Android.

Posted Jul 22, 2020, 2:33 PM UTC

115
Loading comments…