flutter_markdown_latex 0.1.2 copy "flutter_markdown_latex: ^0.1.2" to clipboard
flutter_markdown_latex: ^0.1.2 copied to clipboard

A extension to render LaTeX in markdown for package flutter_markdown.

Flutter Markdown Latex #

Coverage Status Pub Version

This extension is created to enhance the functionality of the flutter_markdown package by adding support for rendering LaTeX in markdown. The rendering of LaTeX is achieved through the utilization of the flutter_math_fork package.

Rendering Samples #

This is inline latex: \$f(x) = \\sum_{i=0}^{n} \\frac{a_i}{1+x}\$

This is block level latex:

\$
c = \\pm\\sqrt{a^2 + b^2}
\$

This is inline latex with displayMode: \$\$f(x) = \\sum_{i=0}^{n} \\frac{a_i}{1+x}\$\$

Example

Getting Started #

Add dependency #

Add flutter_markdown_latex to your pubspec.yaml dependencies.

Import it #

import 'package:flutter_markdown_latex/flutter_markdown_latex.dart';

Render it #

// with default text style
MarkdownBody(
  selectable: true,
  data: 'latex: \$c = \\pm\\sqrt{a^2 + b^2}\$',
  builders: {
    'latex': LatexElementBuilder(),
  },
  extensionSet: md.ExtensionSet(
    [LatexBlockSyntax()],
    [LatexInlineSyntax()],
  ),
),

// with custom text style
MarkdownBody(
  selectable: true,
  data: 'latex: \$c = \\pm\\sqrt{a^2 + b^2}\$',
  builders: {
    'latex': LatexElementBuilder(
      textStyle: const TextStyle(color: Colors.blue),
    ),
  },
  extensionSet: md.ExtensionSet(
    [LatexBlockSyntax()],
    [LatexInlineSyntax()],
  ),
),
14
likes
0
pub points
82%
popularity

Publisher

verified publisherlightbit.dev

A extension to render LaTeX in markdown for package flutter_markdown.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_markdown, flutter_math_fork, markdown

More

Packages that depend on flutter_markdown_latex