flutter_tex 1.0.15 copy "flutter_tex: ^1.0.15" to clipboard
flutter_tex: ^1.0.15 copied to clipboard

outdated

A Flutter Package to render Mathematics / Maths, Physics and Chemistry, Statistics / Stats Equations based on LaTeX with full HTML and JavaScript support.

Flutter TeX #

A Flutter Package to render so many types of equations based on LaTeX, most commonly used are as followings:

  • Mathematics / Maths Equations (Algebra, Calculus, Geometry, Geometry etc...)

  • Physics Equations

  • Signal Processing Equations

  • Chemistry Equations

  • Statistics / Stats Equations

  • It also includes full HTML with JavaScript support.

Rendering of equations depends on mini-mathjax a simplified version of MathJax a JavaScript library.

This package mainly depends on webview_flutter plugin.

Use this package as a library in your flutter Application #

1: Add this to your package's pubspec.yaml file:

dependencies:
  flutter_tex: ^1.0.15

2: You can install packages from the command line:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3: For Android Make sure to add this line android:usesCleartextTraffic="true" in your <project-directory>/android/app/src/main/AndroidManifest.xml under application like this.

<application
       android:usesCleartextTraffic="true">
</application>

and permissions

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

For iOS add following code in your <project-directory>/ios/Runner/Info.plist


<key>NSAppTransportSecurity</key>
  
  <dict>
    <key>NSAllowsArbitraryLoads</key> <true/>
  </dict>

<key>io.flutter.embedded_views_preview</key> <true/> 

4: Now in your Dart code, you can use:

import 'package:flutter_tex/flutter_tex.dart'; 

5: Now you can use TeXHTML widget like this.

    TeXView(
          teXHTML: r"""$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$<br> """,
          
          onRenderFinished: (height) {
                print("Widget Height is : $height")
                },
                
          onPageFinished: (string) {
                print("Page Loading finished");
              },
        )

Complete working application Example

Known Issues: #

  • A bit slow rendering speed. It takes 1-2 seconds to render after application loaded.

Cautions: #

  • Please avoid using too many TeXViews in a single page, because this is based on webview_flutter a complete web browser. Which may cause to slow down your app.

Screenshots #

Screenshot# 01 Screenshot# 02

Tweet Flutter_TeX

276
likes
20
pub points
96%
popularity

Publisher

verified publishershahxad.com

A Flutter Package to render Mathematics / Maths, Physics and Chemistry, Statistics / Stats Equations based on LaTeX with full HTML and JavaScript support.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, mime, webview_flutter

More

Packages that depend on flutter_tex