znjameswu / flutter_math

Math rendering and editing in pure Flutter.
https://znjameswu.github.io/flutter_math_demo/
Apache License 2.0
123 stars 52 forks source link

Line break Distances are unsupported #27

Open creativecreatorormaybenot opened 3 years ago

creativecreatorormaybenot commented 3 years ago

This is somewhat connected to #8.

It is a common use case to use \\[distance] to specify the distances of line breaks.

An example would be \\[3mm].

Example

Check https://katex.org with 1\\2\\[3mm]3 - you will understand it quickly :)

Docs

It is documented below the table in the environments section in the KaTeX docs.

Current situation

image

This is somewhat unfortunate because it is worse than not properly accounting for the distance (the "3mm" should not be contentful).

Solution

I think that this should already be easily possible using the current "Generate a list of broken-down widgets" API style.

A makeshift solution might be to make the parser detect it (adapt it from the KaTeX parser) and just ignore the actual distance. That would already be better than showing it as symbols :)