ForNeVeR / xaml-math

A collection of .NET libraries for rendering mathematical formulae using the LaTeX typesetting style, for the WPF and Avalonia XAML-based frameworks
MIT License
637 stars 100 forks source link

Feature Request: Word Wrap in FormulaControl. #382

Open cvdevol opened 1 year ago

cvdevol commented 1 year ago

Is it possible to implement automatic word wrap so that long formulas can be are split up automatically instead of having to manually add a new line \?

ForNeVeR commented 1 year ago

I fear that would be a very complex and difficult task. Even TeX itself isn't always able to handle this reliably. I heard that amsmath is able to do that, but it's definitely far ahead of what we have implemented right now.

cvdevol commented 1 year ago

If it's possible to get the width of the control, the width of the display area and the size of the font, I suppose you could calculate where the line feed should be placed. But you'd have to be careful not to put it in the middle of a LaTex tag or compound structure like a variable and its subscript or some such thing. So yes, it seems quite elaborate. :-(