Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
790 stars 35 forks source link

on enter block equations for math mode #548

Closed Mc-Zen closed 1 month ago

Mc-Zen commented 3 months ago

Thanks for this awesome LSP! I love it.

I want to suggest that hitting Enter after inserting a $ produces

$
  |    ← cursor
$

just as with {, (, or [. This would greatly improve the workflow of writing display style equations. As specific usecase I have longer and more complex equations in mind that require multiple lines. Or just to improve source code readability by setting block equations visually apart from the text.

This feature could also be an option that can be turned on or off.

Myriad-Dreamin commented 3 months ago

looks nice, it can also be simply implemented, but I wonder whether typstyle will remove the empty indents. This might introduce some inharmony.

Mc-Zen commented 3 months ago

Do you mean whether it will remove them immediately? Is the formatter (if activated) called automatically?

Myriad-Dreamin commented 3 months ago

Do you mean whether it will remove them immediately? Is the formatter (if activated) called automatically?

Yes.

Enter-tainer commented 3 months ago

It is actually not formatter's fault. Typst's parser thinks that $ $ is inline equation for some reason. If it is fixed, formatter should work out of the box. see linked issue above https://github.com/typst/typst/issues/4791

Mc-Zen commented 3 months ago

Nice!

Mc-Zen commented 1 month ago

Amazing, thank you!