flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
7.91k stars 267 forks source link

Add typst support to typewriter #644

Open LuckyTurtleDev opened 1 year ago

LuckyTurtleDev commented 1 year ago

Please submit only one feature request in one issue!
Add typst support to typewriter.

Is your feature request related to a problem? Please describe.
I like the option that rnote allow creating documents combining text input imported pictures and handwritten notes. But sometimes I also would like to write mathematical formula or formatted text by using the typewriter. Typst should be a nice solution for this, because the syntax is powerful and still very simple.

Describe the solution you'd like
An option to enable typst can be added at this menu. image For this the typst crate, which does also provide a lib, can be used. The disadvantage of this is that the typst is currently not published at cartes.io, which would also block rnote releases on crates.io.

Describe alternatives you've considered
Write hard to read formula with hand.

k12ish commented 1 year ago

I think this issue is a little lacking in technical implementation details with regards to:

  1. Which features from Typst are wanted?
  2. How does this fit in with Typst's incremental compilation model?
  3. How does this fit in with Rnote's SVG, PDF, Xopp export?
  4. Is Typst stable enough to use?

I think Typst integration is possible implemented in a manner similar to how Wikipedia renders LaTeX:

<img 
       <!-- replace source with base64 encoded image of typst rendered Math -->
    src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c1646655eab602e234f42df85cae241ffbb867cf" 
    class="mwe-math-fallback-image-inline" 
    aria-hidden="true" 
    style="vertical-align: -3.005ex; width:34.278ex; height:7.176ex;" 
    alt="{\displaystyle {\begin{aligned}\sin z&amp;=\sin x\cosh y+i\cos x\sinh y\\[5pt]\cos z&amp;=\cos x\cosh y-i\sin x\sinh y\end{aligned}}}"
>

Typst is relatively immature right now, and I don't think it's worth burdening core maintainers with this.

LeSnake04 commented 1 year ago

I think markdown with katex makes more sense for now, as suggested in #659

Kreijstal commented 11 months ago

Typst makes sense because it is really fast, is pure rust, so no extra dependencies, and it's such a joy to use. https://github.com/typst/typst/issues/2450 unfortunately is not yet in crates.io but hopefully it will be soon