Typst and other alternatives to LaTeX

I tried it, but I am much more comfortable in Emacs + AUCTeX + preview-latex (which renders the equations).

My main issue with LaTeX is not the compilation time, it is the amount of line noise when writing math. It is very easy to add typos just because of being lost in the forest of the \{}s. typst looks like it was designed to mitigate that a bit, but only experience will tell.

3 Likes

Not an issue with the LyX equation editor, which eliminates the brackets as you type. e.g. type \frac and it immediately turns into a fraction with boxes for numerator and denominator that you can move to with arrow keys and fill in. There is also a graphical menu if you forget how to type some weird symbol (whose tooltips show you the \shortcut too), and the array editor is a pleasure.

(This is very different from having side-by-side rendering of the equation in a separate pane while you edit the raw equation as text in another!)

If you have a custom macro then it will stay as \foo{…} until you exit the equation, but usually these are only a small part of the equation.

2 Likes

Yes, I know LyX, I used it for years. I just find Emacs much nicer, the keystrokes are in muscle memory.

That’s not what I was talking about. preview-latex just renders the equations (or figures, or whatever the user wants) when the cursor is not inside them. Like this:

I hope someone makes an Emacs minor mode doing that for typst. Full preview is already available:

3 Likes

Still not the same as rendering while you edit. (i.e. while the cursor is inside the equation, you edit the rendered equation.)

1 Like

Sure, everyone has their preferences. I imagine that whatever the preferred GUI is, the incremental compilation feature of typst should make it easier/faster to implement than for LaTeX.

I’m curious specifically about the difference in experience between writing a Quarto Markdown file with Typst as the format option (link) vs.writing a Typst file with TypstJlyfish.jl to include code results. My use-case would be writing design reports.

The first paragraph in TypstJlyfish.jl addresses this.

You should use Jlyfish if you want to write a Typst document and have some of the content automatically produced by Julia code but want the source code for that within your document source. It fills a similar role as PythonTeX does for Python and LaTeX. Note that this is different from tools like Quarto where you write documents in Markdown, also integrate some Julia code, but then might use Typst only as a backend to produce the final document.

The main difference is, I gather, that with TypstJlyfish you actually write Typst documents with Typst syntax (which is very different from either LaTeX or Markdown).

1 Like

Yeah, just wondering anecdotally if anyone had tried both and found one preferable for whatever reason.

I prefer Typst over Quarto. I use it to write reports and make study notes, with the Julia code and its output accompanying the mathematics nicely.

Typst has a major roadmap focus on html output as well. With the limitations and difficulties of Julia’s current documentation ecosystem, I’m anticipating and hoping that Typst documents will be a nice way to document Julia packages.

My personal preference for Typst is due to the nice balance of: If I want something typed down quick, I can use Typst like a Markdown file: just get my notes down. If I want something polished and professional, I also use Typst. And my experience with typesetting in Typst is akin to programming in Julia — it makes me feel empowered, and gets out of my way of doing the task I’m trying to do.

The current interop of Julia code execution in Typst documents works well imo, a little rudimentary, but I can also see how much enormous potential it has. Just as I’ve been excited for Julia’s progress over the years, I’ve become excited for Typst, and glad to see some people finally producing a LaTeX competitor.

9 Likes

This :100:. It’s why typst feels like such a natural ally with Julia. All the power, but simplicity and elegance too.

3 Likes

Exactly! Just two small-ish features Typst is missing that I want then I’m content with it:

  1. Julia unicode completion/insertion, just like in Julia nd Markdown files.

  2. Execute code straight from a Typst file to my active VS Code Julia REPL session, like we can with Markdown files currently.

But even without these two features, I’ve been using it and it’s been awesome.

Sorry to be that guy, but this is doable with other tools - eg I use nvim/vim-slime and it will throw whatever is under my cursor to whatever terminal I pick (this sometimes leads to hilariously wrong behavior).

Not that I would ever advocate someone switch to nvim for this kind of functionality :person_shrugging:

1 Like

I wrote a journal paper and made a few presentations w/ Quarto. I love the idea of it, but in practice the markdown syntax for styling is very cumbersome and seems to get in the way of actually getting work done. Debugging (espcially for sytling) is also difficult. Quarto has the “two-language” problem on steroids.
With that said, the output you can produce for HTML and RevealJS presentations is awesome.

~6 months ago I start playing w/ Typst. The experience has been significantly better for both papers and presentations. I haven’t tried using something like TypstJlyfish.jl yet. I’ve been keeping my source julia files separate. I run them, save the results, and load in Typst. You can load and display the source code files (or specific lines) as code blocks w/ GitHub - jneug/typst-codelst: A typst package to render sourcecode. I put it all in a justfile so it can be reproduced.

I actually think (jury’s still out) I actually prefer this vs. having the code directly in the paper. For me, writing prose is the difficult part. Having the code right there is a distraction.

6 Likes

I haven’t had time to test (since I discovered Typst yesterday), but Typst accepts unicode, so isn’t this just an editor plugin issue? I mean not really a Typst issue?

1 Like

Yep, so both my wishes are moreso referring to the ecosystem for Typst.

My primary Tyspst wishlist is HTML output (coming soon :crossed_fingers:) and the ability to define multiple methods for a function like in Julia. E.g. in Typst I have

#let indicator(A, ..args) = {
  let root = $bb(1)_#A$
  if args.pos().len() == 0 {
    root
  } else {
    let f = args.pos().at(0)
    $root (#f)$
  }
}

$
indicator(Omega)\
indicator(Omega, x)
$

I really wish I could just do

#let indicator(A) = {
   $bb(1)_#A$
}

#let indicator(A, x) = {
   $indicator(#A) (#x)$
}

4 Likes

Adding the multiple methods to my wishlist as well :smile:

Rust/Typst devs gonna discover multiple dispatch was the way to go :stuck_out_tongue:

2 Likes

I’d be curious to hear peoples thoughts on Scribble (“The Racket Documentation Tool”) vs Typst. Maybe someone’s already done that at some link somewhere?

1 Like

Can it output latex? I had used Pandoc before, and for cases when I needed to submit the latex source files it was simply another output option. Could typst be made to do the conversion?

Typst does not spit out latex. There is pandoc support, but my experience for anything marginally complex was not amazing. Though in fairness that was more than a year ago so things may have improved. If LaTeX is required, I don’t think that starting from typst is a good choice. I managed to use Adobe’s docx converter from the PDF and it was flawless though