Skip to content
pubscout

flutter_markdown_latex

0.3.4, released 2 years ago by lightbit.dev

An extension to render LaTeX equations inside flutter_markdown widgets.

WASM-ready
$ flutter pub add flutter_markdown_latex
Source repository

What it does

Extends the flutter_markdown package to parse and render both inline and block LaTeX expressions. It relies on flutter_math_fork under the hood to display mathematical formulas.

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

Use it when

  • You need to display mathematical formulas written in LaTeX inside markdown text in a Flutter app.
  • You are already using flutter_markdown and want to add LaTeX rendering support.

Skip it when

  • You do not use markdown and just need standalone LaTeX rendering widgets.
  • You require a non-Flutter Dart environment.

Strengths

  • Supports both inline and block LaTeX syntax.
  • Provides custom element builders for controlling text style and text scale factor.

Weaknesses

  • Adds an extra configuration overhead to the standard markdown widget via specific extension sets and element builders.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3
MarkdownBody(
  selectable: true,
  data: 'latex: \$c = \pm\sqrt{a^2 + b^2}\$',
  builders: {
    'latex': LatexElementBuilder(),
  },
  extensionSet: md.ExtensionSet(
    [LatexBlockSyntax()],
    [LatexInlineSyntax()],
  ),
)

Alternatives

Packages that do the same job and could replace flutter_markdown_latex.

Works with

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