Skip to content

[feature request]: Support rendering LaTeX math expressions in documentation comments #4277

Description

@dzylikecode

It would be useful if Dart documentation comments could render mathematical expressions written in LaTeX syntax.

Dart documentation comments already support Markdown, but currently there is no built-in way to render mathematical formulas in generated API documentation.

For example, it would be nice to write:

/// Computes the loss function:
///
/// $$
/// L(\theta) = \frac{1}{N}\sum_{i=1}^{N}
/// (f_\theta(x_i) - y_i)^2
/// $$
///
/// The gradient is $\nabla_\theta L(\theta)$.
double loss(...) {
  ...
}

and have dart doc render both the block and inline equations as formatted mathematics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions