Custom TeX Markdown

A Flutter package for rendering custom Markdown with LaTeX support, legacy image handling, and specific custom tags.

Features

  • Renders Markdown using flutter_markdown.
  • Supports LaTeX math equations via flutter_math_fork.
  • Handles custom tags like {CORRECT:...}, {WRONG:...}, {u:...}, etc.
  • Supports legacy image tags <image="...">.

Supported Formats

Standard Markdown

Supports all standard Markdown features (bold, italic, lists, etc.) provided by the flutter_markdown package.

LaTeX Math

Render mathematical equations using LaTeX syntax:

  • Inline: Use single dollar signs, e.g., $E=mc^2$
  • Block: Use double dollar signs, e.g.,
    $$
    \int_0^\infty x^2 dx
    $$
    

Custom Tags

Special tags for educational content:

  • {CORRECT:...}: Renders text in green (e.g., {CORRECT:Correct Answer}).
  • {WRONG:...}: Renders text in red (e.g., {WRONG:Wrong Answer}).
  • {u:...}: Renders underlined text (e.g., {u:Important}).

Legacy Images

Supports a custom image tag format:

  • <image="URL">: Renders an image from the specified URL.

Getting started

Add the dependency to your pubspec.yaml:

dependencies:
  custom_tex_markdown: ^0.0.1

Usage

import 'package:custom_tex_markdown/custom_tex_markdown.dart';

// Use NoteRenderer or TexText widgets
NoteRenderer(
  "This is some **markdown** with LaTeX: \$E=mc^2\$",
)

// Or use TexText for simple text alignment
TexText(
  "Centered LaTeX: \$\$E=mc^2\$\$",
  textAlign: TextAlign.center,
)

Additional information

For more information, visit the repository.