Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use

Typst is awesome, in particular if you want to generate documents programmatically.

  • 2xsaiko@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    This is a great project. The way it handles mixing markup and code is on point. Also, for drawing its CeTZ is so much nicer than TiKZ, the LaTeX equivalent. I made some great graphics with it for a seminar presentation and paper that I couldn’t have done anywhere near as easily with LaTeX. (The presentation slides I made entirely with Typst, the paper had a LaTeX template that I didn’t feel like remaking because it was huge so I just embedded the graphics I made with Typst)

  • Cpo@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    14 days ago

    I am currently using it from a backend to generate pdfs.

    One thing that prevents me from letting users build their own templates is the scripting capabilities. A joker creating an endless loop could block the whole server.

    What would be nice is a “safe” mode in which no access to the file system (include and sorts) and limited runtime makes it safe to let users build their own templates.

    • KillTheMule@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      13 days ago

      One thing that prevents me from letting users build their own templates is the scripting capabilities. A joker creating an endless loop could block the whole server.

      I know little about servers, but can’t you run the generation in a thread with a timeout or so? Or maybe compile to wasm and let the generation run on the users machines? I also know little about wasm, but I’d have guessed it has facilities to keep runtime and load under control.

      What would be nice is a “safe” mode in which no access to the file system (include and sorts) and limited runtime makes it safe to let users build their own templates.

      Ah, are you by chance shelling out to the typst binary? You can actually use typst as a library, and then you’ve got full control over the files involved, so it’s “safe” in that respect.

      • Cpo@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        DUDE!

        You are the man!

        I did know it was built in rust but never realized I could also use it as a library!

        🎉

        • KillTheMule@programming.devOP
          link
          fedilink
          arrow-up
          1
          ·
          13 days ago

          Yeah I was very happy to find that out. I was calling latex externally before, and there was a lot of pain interacting with the filesystem and temporary files. Now it all happens in-memory :)