# Typst and other alternatives to LaTeX

**URL:** https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652
**Category:** Offtopic
**Tags:** latex
**Created:** [October 22, 2024, 1:45am UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652 "2024-10-22T01:45:53Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 23, 2024, 4:29pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/21 "2024-10-23T16:29:56Z")

</div>

> [@NonDairyNeutrino](#):
>
> Typst offers the power of LaTeX with the ease of Markdown

I hope it does much more. LaTeX is very powerful when it comes to the package ecosystem, but it is a horrible language to program in. The [scripting language of typst](https://typst.app/docs/reference/scripting/) seems pretty decent, with all modern features (namespaces, closures, etc). It just needs multiple dispatch 😉

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [October 23, 2024, 4:31pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/22 "2024-10-23T16:31:43Z")

</div>

> [@kevbonham](#):
>
> I think typst is like the Julia of typesetting

Perhaps more like JuliaSim of typesetting: [Typst: Pricing](https://typst.app/pricing/).

EDIT: indeed, as pointed out in the comments, there is an open-source typst CLI. Sorry for the ignorance. I have finally learnt that typst is not just the web app.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 23, 2024, 4:35pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/23 "2024-10-23T16:35:36Z")

</div>

@zdenek_hurak: I think you are confusing the language and the compiler (FOSS) with the web-based collaborative app (not unlike Overleaf vs LaTeX).

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [October 23, 2024, 4:40pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/24 "2024-10-23T16:40:25Z")

</div>

I see. Only now have I finally read about the typst CLI. Thanks for this correction. Indeed, I thought that it only exists as a web app.

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [October 23, 2024, 4:43pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/25 "2024-10-23T16:43:16Z")

</div>

> [@Tamas\_Papp](#):
>
> not unlike Overleaf vs LaTeX

Yes, though in this case, it’s the same people - my understanding is that the paid version of the typst web app is to support the development of the oss project (I don’t actually know the relationship between overleaf and latex). So here, I think maybe the typst web app and typst is most analogous to JuliaHub / Julia.

But yes, the typst compiler is open source/free, and I believe they’ve said that the web app will remain freemium

---

<div class="post-metadata">

### Author: ![NonDairyNeutrino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nondairyneutrino/32/221496_2.png) [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)
#### Post date: [October 23, 2024, 4:45pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/26 "2024-10-23T16:45:18Z")

</div>

> [@NonDairyNeutrino](#):
>
> I’m also curious to see how this integrates into literate programming like with [Literate.jl](https://juliahub.com/ui/Packages/General/Literate), as to me they seem pretty complimentary.

Just doing some cursory looking around and found TypstJlyfish.jl and the [jlyfish](https://typst.app/universe/package/jlyfish/) Typst package.

> Jlyfish is a package for Julia and Typst that allows you to integrate Julia computations in your Typst document.

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [October 23, 2024, 4:46pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/27 "2024-10-23T16:46:29Z")

</div>

> [@NonDairyNeutrino](#):
>
> Typst offers the power of LaTeX

Perhaps “the power of TeX”?

TeX is the rock solid underpinnings, the typesetting language itself. LaTeX is a set of macros that make interfacing with TeX a _bit_ easier, but still awkward as all get out.

---

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [October 23, 2024, 4:51pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/28 "2024-10-23T16:51:13Z")

</div>

I’ve been using typst very extensively for the better part of a year now. As nice as it is, for me the real killer feature is the ergonomics of writing math, which I find vastly better than any other method. This mostly comes down to the particular markdown language they use for math which goes to great lengths to eliminate “line noise” (occasionally at the cost of reasonable syntax) but the ease of scripting also makes generating text drastically easier than it is in latex. (It is also a surprisingly good scripting language, my only gripe is that I find data structures a bit on the complicated side and it would benefit from better pattern matching tools.)

By the way, as soon as they officially release the HTML target, I will be dead set on making it possible to do Julia package docs mostly in typst, so you can be sure I’ll be working on that if nobody beats me to it.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 23, 2024, 5:00pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/29 "2024-10-23T17:00:00Z")

</div>

> [@NonDairyNeutrino](#):
>
> As someone who usually only needs the basics like math, figures, itemized & numbered lists, etc., it results in something basically indistinguishable from what LaTeX would produce (including an open source version of the iconic Computer Modern font), in a much more straightforward fashion.

Have you tried LyX ([www.lyx.org](http://www.lyx.org))? It generates LaTeX under the hood (and gives access to all of LaTeX if you want it), its equation editor is a pleasure to use (you can type LaTeX syntax or select from menus, and you see the results as you type), and it lets you skip all of the fussing with syntax and compilation errors for most editing. I like its [“WYSIWYM”](https://wiki.lyx.org/Glossary/WYSIWYM) philosophy of focusing on content rather than on structure — you don’t need to continually compile things just to make the text readable while you edit it, so the performance issue of LaTeX goes away.

The only reason I don’t use LyX for everything is that it doesn’t offer the “google docs” live collaboration experience of Overleaf, which is nice for collaborative papers.

---

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [October 23, 2024, 5:09pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/30 "2024-10-23T17:09:19Z")

</div>

> [@stevengj](#):
>
> you don’t need to continually compile things just to make the text readable while you edit it, so the performance issue of LaTeX goes away.

One of the main features of typst is incremental compilation, so it is extremely fast. As far as I know this is what the GUI app is doing while you type, or you can do this via the command line via `typst watch`. My current setup does this with `nvim` whenever the file is saved, but at some point I may set it up to watch the buffer (I actually don’t really care about seeing changes as I type, but error messages in the PDF itself is something that I would like which typst does not currently offer).

---

<div class="post-metadata">

### Author: ![jakobjpeters](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobjpeters/32/207797_2.png) [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)
#### Post date: [October 23, 2024, 7:15pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/31 "2024-10-23T19:15:18Z")

</div>

> [@NonDairyNeutrino](#):
>
> > [@kevbonham](#):
> >
> > See also [Home · Typstry.jl](https://jakobjpeters.github.io/Typstry.jl/stable/)
> 
> I’m also curious to see how this integrates into literate programming like with [Literate.jl](https://juliahub.com/ui/Packages/General/Literate), as to me they seem pretty complimentary.

A quick and crude test indicates that Typstry.jl + Literate.jl works a little but has some issues.

IJulia.jl works on `Typstry.Typst` and `Typstry.TypstText` and will support `Typstry.TypstString` once this [new version](https://github.com/JuliaRegistries/General/pull/117251) is merged. Literate.jl seems to pre-render `TypstString`s correctly, but the image breaks on re-evaluation.

`makedocs` on the generated markdown file attempts and fails to run a regex on the `TypstString`, and I’m not sure what would fix this. It can however render `Typst` and `TypstText` though.

Other than the issues above, is there anything else you’d want to do with Typstry.jl + Literate.jl?

> [@ExpandingMan](#):
>
> By the way, as soon as they officially release the HTML target, I will be dead set on making it possible to do Julia package docs mostly in typst, so you can be sure I’ll be working on that if nobody beats me to it.

This would be awesome! Would this look like completely replacing Markdown files and docstrings with Typst files and snippets? Would it plugin to Documenter.jl or be a standalone package?

#### note

If anyone is using Typstry.jl 's Julia-value to Typst-code formatting feature, please submit requests for types and packages! Other feedback and requests welcome too 😃

---

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [October 23, 2024, 7:24pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/32 "2024-10-23T19:24:23Z")

</div>

> [@jakobjpeters](#):
>
> This would be awesome! Would this look like completely replacing Markdown files and docstrings with Typst files and snippets? Would it plugin to [Documenter.jl](https://juliahub.com/ui/Packages/General/Documenter) or be a standalone package?

My first attempt would be merely replacing the HTML generation step in documenter with typst, using whatever functions it already uses to pull out the docstrings and generate typst source code for it. So yeah, no markdown. Obviously I haven’t actually done this so we’ll see.

---

<div class="post-metadata">

### Author: ![brainandforce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brainandforce/32/211054_2.png) [@brainandforce](https://discourse.julialang.org/u/brainandforce)
#### Post date: [October 23, 2024, 7:32pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/33 "2024-10-23T19:32:23Z")

</div>

My big question about typst is: does it have decent package management?

One of the biggest shocks I had when setting up TeXLive locally was that standard practice is to install most, if not all packages simultaneously, which takes up a huge amount of space. Starting with a minimal install is an arduous process and results in some really unexpected behavior (like a lack of Unicode support in pdflatex).

(I’d like to believe that I’ve done TeXLive minimal installs completely wrong and missed something important rather than it being the painful process that it was)

---

<div class="post-metadata">

### Author: ![jakobjpeters](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobjpeters/32/207797_2.png) [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)
#### Post date: [October 23, 2024, 7:44pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/34 "2024-10-23T19:44:28Z")

</div>

> [@ExpandingMan](#):
>
> My first attempt would be merely replacing the HTML generation step in documenter with typst, using whatever functions it already uses to pull out the docstrings and generate typst source code for it. So yeah, no markdown. Obviously I haven’t actually done this so we’ll see.

TypstJlyfish.jl seems to basically implement Documenter.jl 's `@example`, and `@eval` in this context, so it could be a good place to build upon or reference to implement [the other syntax](https://documenter.juliadocs.org/stable/man/syntax/).

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [October 23, 2024, 7:54pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/35 "2024-10-23T19:54:02Z")

</div>

> [@brainandforce](#):
>
> My big question about typst is: does it have decent package management?

Yeah, it’s encoded in the document, and seems to automagically download when needed. You can see it in the first two lines of the example I posted above:

```typst
#import "@preview/pinit:0.2.2": *
#import "@preview/fletcher:0.5.1"

Con#pin(1)#h(4em)#pin(2)nect

#pinit-fletcher-edge(
  fletcher, 1, end: 2, (1, 0), [bend], bend: -20deg, "<->",
  decorations: fletcher.cetz.decorations.wave.with(amplitude: .1),
)

```

You can create a new file with that content, `typst compile that_file.typ` and it will render correctly. Nothing else required.

The `@preview` thing seems to direct to the typst “universe” which is their package repository, but you can also provide github repos or local directories

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 23, 2024, 8:24pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/36 "2024-10-23T20:24:27Z")

</div>

> [@ExpandingMan](#):
>
> One of the main features of typst is incremental compilation, so it is extremely fast. As far as I know this is what the GUI app is doing while you type, or you can do this via the command line via `typst watch`.

The whole point is that I don’t want to worry about the precise appearance while I type. I don’t want to compile/render _at all_ while I’m typing, no matter how fast it is. I want to worry about the content — for this, things need to be _readable_ (equations must render, headings should appear in a big font with correct numbering, bold text should be bold, etc.), but they don’t need to appear exactly as they do in the final document. And I don’t want compilation errors to even be _possible_ for the most part. Both of these are a big advantage of using a WYSIWYM GUI like LyX — which does _not_ do full LaTeX compilation/rendering as you type — whereas the rendering backend is mostly orthogonal to this.

As far as I can tell, the main reason people care about fast compilation with LaTeX is that it is so unreadable in source form — without compiling/rendering, it is hard to tell whether you got an equation correct, or if you made a syntax typo. Otherwise, you only need to compile in the final “tweaking the appearance” stage, and that’s usually a small part of the writing process (especially for technical documents that mainly use pre-existing stylesheets).

(To be clear, I _don’t_ want a WYSI **WYG** GUI like Word, even if Word didn’t suck. I don’t want to be worrying about formatting details while I’m trying to write.)

(It always shocks me how few LaTeX users have ever used LyX — which is free/open-source, cross-platform, and mature from many years of development. In my department (Math), most people have not even heard of it.)

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [October 23, 2024, 8:30pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/37 "2024-10-23T20:30:16Z")

</div>

> [@jlapeyre](#):
>
> To be clear, I think that there is no question whatsoever that arXiv should exclude Typst documents at present. My issue is with the reason given.

Why’s that ? Wouldn’t it be a good thing if arXiv accepted Typst ?  
It seems clear to me that if journals (or preprint servers) do not accept Typst, no one will really use it.

It’s a long thread sorry if I missed the argument somewhere.

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [October 23, 2024, 8:41pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/38 "2024-10-23T20:41:19Z")

</div>

> [@e3c6](#):
>
> Why’s that ? Wouldn’t it be a good thing if arXiv accepted Typst ?

I don’t know if it would be a good thing - I mean, **I think** it would be great, but I can understand their perspective. If they open the door to one kind of thing, then they have to worry about people asking about all kinds of other things (eg manubot I mentioned before, PreTeXt that someone else mentioned, whatever else.

Hell, even just dealing with keeping the compile toolchain current / being able to match documents with the right version of the compiler (eg a bunch of breaking changes for typst were just released) would be a hassle from a maintenance perspective.

> [@e3c6](#):
>
> It seems clear to me that if journals (or preprint servers) do not accept Typst, no one will really use it.

If they accept PDFs, I don’t think it matters. Hell, most of the journals I submit to (and the preprint servers I use, bioRxiv and medRxiv) don’t even accept LaTex.

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [October 23, 2024, 9:22pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/39 "2024-10-23T21:22:39Z")

</div>

I agree, LyX is great. So is Bakoma. But no matter how good these are, they are not WYSIWYM. More like WYSIWIM (what you see is what _I_ mean, where _I_ is the compiler). What I (as the user) mean is often not what I see. 😉  
TeX (LaTeX) are complicated, full of little idiosyncrasies… It would be nice if the “programming” language underlying the typesetting system was a bit more user-friendly.

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [October 23, 2024, 9:47pm UTC](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652/40 "2024-10-23T21:47:09Z")

</div>

> [@kevbonham](#):
>
> If they accept PDFs, I don’t think it matters.

True.

> [@kevbonham](#):
>
> Hell, most of the journals I submit to (and the preprint servers I use, bioRxiv and medRxiv) don’t even accept LaTex.

For me it’s the opposite, most journals I know accept LaTeX. Although many journals let you submit a PDF initially, for publication they will ask for the sources.

[Previous page](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652.md?page=1)

[Next page](https://discourse.julialang.org/t/typst-and-other-alternatives-to-latex/121652.md?page=3)
