搜索插件、代码仓与 APP 分类

插件详情v0.5.1

latext

使用 flutter_math 库在 Android、iOS、Web 和桌面平台上高效显示科学 LaTeX 方程,无需依赖 WebView 或 JavaScript。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1720
喜欢数
40
Pub 分数
155

安装插件

flutter pub add latext

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Latext 是一个 Flutter 包,能够高效地在 Android、iOS、Web、macOS、Windows 和 Linux 上渲染科学 LaTeX 公式,无需使用 WebView 或 JavaScript。基于 flutter_math 构建,它提供高质量的原生平台方程式显示,具有快速性能和精确的排版。适用于教育类应用、研究工具和技术文档,Latext 确保在不同目标平台上的一致性渲染。该包支持复杂的数学表达式,并可无缝集成到现有的 Flutter 项目中。

适合场景

  • 教育类应用
  • 研究与学术工具
  • 技术文档
  • Web 和桌面应用程序中的数学内容
  • 互动式学习平台

主要特点

  • 原生渲染,无需 WebView
  • 跨平台兼容性
  • 高性能方程显示
  • 支持复杂的 LaTeX 语法
  • 与 Flutter 的无缝集成

适合对象

  • 开发数学密集型应用程序的开发者
  • 教育工作者创建互动学习体验
  • 针对多个平台且具有统一用户界面的团队
  • 需要精确数学排版的应用程序

使用建议

  • 仅限LaTeX公式渲染
  • 需要理解 LaTeX 语法
  • 可能对高级LaTeX包的支持有限
  • 最适合静态或半动态数学内容

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

latext

Render scientific LaTeX equations using the LaTexT library.

  • Mathematics / Maths Equations (Algebra, Calculus, Geometry, Geometry etc...)
  • Physics Equations
  • Signal Processing Equations
  • Chemistry Equations
  • Statistics / Stats Equations
  • Inherit text style from parent widgets

LaTeX rendering is done using flutter_math_fork and using RichText.

latext is working on Android, iOS, the Web and the Desktop platform.

What's the difference to flutter_math_fork library?

flutter_math_fork is simply taking any input for Math rendering. We split up into Text and Math parts. You can use a separator (eg. the common "$" or "$$"). Content between these separators is rendered as math while anything outside of these separators is rendered as normal Flutter Text. This makes Text containing only some single formula parts much easier.

Use this package as a library

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

dependencies:
  latext: ^0.4.1

You can install packages from the command line with Flutter:

flutter pub get

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

Now in your Dart code, you can use:

import 'package:latext/latext.dart';

...

// A static LaTeX block which may not change on `setState()`
return LaTexT(laTeXCode: Text("\\alpha", style: Theme.of(context)
                      .textTheme
                      .bodyText1
                      .copyWith(color: Colors.red)))

// A dynamic LaTeX block which is rebuilt on `setState()` (less efficient but required sometimes)
return Builder(builder: (context) => LaTexT(laTeXCode: Text("\\alpha", style: Theme.of(context)
                      .textTheme
                      .bodyText1
                      .copyWith(color: Colors.red))))

This package was adapted from KaTexFlutter.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目