top | item 44350322

I wrote my PhD Thesis in Typst

532 points| todsacerdoti | 8 months ago |fransskarman.com

328 comments

order
[+] WhyNotHugo|8 months ago|reply
Typst looks really promising, especially due to the fact that it had common templates (like the IEEE one) which produce content identical to LaTeX.

My biggest gripe with latex is the tooling. During my last paper, I ended up using a makefile which would usually work. When it didn’t work, running it twice would fix the issue. In the rarest cases, I had to run `git clean -xdf` and the next run would work.

I still have no idea what was going on, and most makefiles out there seem to be obscenely complex and simply parse the output and run the same commands again if a certain set of errors occurred.

[+] shusaku|8 months ago|reply
The definition of insanity is doing the same thing twice and expecting different results.

By coincidence, this is the basic way to compile latex.

[+] Aurornis|8 months ago|reply
> My biggest gripe with latex is the tooling. During my last paper, I ended up using a makefile which would usually work. When it didn’t work, running it twice would fix the issue. In the rarest cases, I had to run `git clean -xdf` and the next run would work.

I always feel like I’m doing something wrong when I have to deal with LaTeX and lose hours to fighting with the tooling. Even with a clean install on a new machine it feels like something fails to work.

The last time I had to change a document I had to go through what felt like 100 different search results of people with the same issue before I found one where there was a resolution and it was completely obscure. I tried to help out by reposting the answer to a couple other locations, but I was so exhausted that I swore off LaTeX for any future work unless absolutely unavoidable.

[+] pcfwik|8 months ago|reply
Absolutely not a perfect solution, and maybe you're already using it within your Makefiles, but for anyone who doesn't yet know about it there's Latexmk[1] which is supposed to automate all of this hassle. I think at least on Debian it's included with texlive-full. In addition it has some nice flags like `-outdir` which lets you send all the crazy LaTeX intermediate build/aux files to a separate directory that's easy to gitignore.

https://mgeier.github.io/latexmk.html#running-latexmk

[+] jeffparsons|8 months ago|reply
I think I used to understand this, but it's been a long time since I had to write any serious LaTeX, so I don't anymore. I found this snippet in my personal _quick-build-latex_ script from over a decade ago:

    if [ -z "$(find . -name "*.bib" -print0)" ]; then
        # Just two runs, to cover TOC building, etc.
        pdflatex -interaction=nonstopmode "$SOURCE_FILE" && \
        pdflatex -interaction=nonstopmode "$SOURCE_FILE"
    else
        pdflatex -interaction=nonstopmode "$SOURCE_FILE" && \
        bibtex "$SOURCE_FILE" && \
        pdflatex -interaction=nonstopmode "$SOURCE_FILE" && \
        pdflatex -interaction=nonstopmode "$SOURCE_FILE"
    fi
So I guess if you're using bibtex, then you need to run it three times, but otherwise only twice?

This is to say... I'm glad those days are gone.

[+] _Algernon_|8 months ago|reply
Why didn't you use latexmk? It deals with the recompiling for you.
[+] Evidlo|8 months ago|reply
Just use Tectonic nowadays for compiling LaTeX source. It automatically handles these cases of compiling multiple times.
[+] jonathanstrange|8 months ago|reply
What do you mean by tooling? I've used LaTeX for decades to write books and papers and the combination with Emacs was flawless. The only major change for me was the transition from Bibtex to Biblatex.
[+] veunes|8 months ago|reply
One of the things that really interests me about Typst is that the compile process seems much more deterministic and modern
[+] gumbojuice|8 months ago|reply
I'm sticking with LaTeX, not as a fetish, but because journal/conferences still do not accept e.g. typst. Will they ever do? I don't know, depends on their willingness to integrate it into their toolchains I guess?
[+] ykonstant|8 months ago|reply
I sincerely doubt they will: most journals in pure math still do not accept LuaTeX; just think about that.
[+] Paapaa|8 months ago|reply
There are already at least two publishers which accept Typst. So that "ever" part is already covered. But most still don't accept Typst and LaTeX is usually mandatory if the sources are required.
[+] dimatura|8 months ago|reply
Yeah, that was my first thought. And it's not just about them accepting typst, but also whether they would provide a template using typst, like they currently do for latex. Using the conference/journal template to write the article saves a lot of time for both submitters and editors (who have to deal with hundreds, if not thousands of submissions).
[+] thezoq2|8 months ago|reply
That is for sure my biggest concern with typst. I wrote a tool that can convert from typst to latex for final submissions, but it is a bit sketchy and at the moment won't handle math very well. https://gitlab.com/theZoq2/ttt
[+] Zariff|8 months ago|reply
I'm not familiar with how journal submissions work, but don't you simply submit a pdf at the end? Does it matter what engine you used to render it?
[+] TimorousBestie|8 months ago|reply
I’m gradually moving my work over to Typst and it’s been a breath of fresh air. Compiles very quickly.

Perhaps the hardest part has been relearning the syntax for math notation; Typst has some interesting opinions in this space.

[+] wenc|8 months ago|reply
Typst looks good, but I'm actually going back to LaTeX but paired with Claude Code in VS Code.

I took a hiatus from LaTeX (got my PhD more than a decade ago). I used to know TikZ commands by heart, and I used to write sophisticated preambles (lots of \newcommand). I still remember LaTeX math notation (it's in my muscle memory, and it's used everywhere including in Markdown), but I'd forgotten all the other stuff.

Claude Code, amazingly, knows all that other stuff. I just tell it what I want and it gets 95% of the way there in 1-2 shots.

Not only that, it can figure out the error messages. The biggest pain in the neck with LaTeX is figuring out what went wrong. With Claude, that's not such a big issue.

[+] kzrdude|8 months ago|reply
One relatively optimistic prediction would be that a few will accept Typst, but latex export from Typst will gradually get more mature, until we end up with a charade where more people use other frontends like Quarto or Typst that output to latex rather than latex themselves for submission into journals - in certain fields. Somewhere after that time, Typst will break through and be generally accepted itself.
[+] PatronBernard|8 months ago|reply
I hate a lot of things about LaTeX (also wrote several theses in it, as well as research articles), but the math syntax definitely wasn't one of them. Why on earth would they change it?
[+] lizimo|8 months ago|reply
We [1] have been using Typst to generate PDF documents in production for a few months, such as invoices and labels. It's generating thousands of documents daily, and I'm glad that some of them are printed and used by people in the warehouse who are doing real work.

I really like the simple syntax that Typst provides. It would be much harder for the PMs to edit the templates if we went with other solutions, such as wkhtmltopdf.

We also looked into other document generation services that provide a WYSIWYG interface, and they are all quite expensive and often lack advanced scripting capabilities.

[1] https://garnercorp.com/

[+] lol768|8 months ago|reply
How have you found the generation performance? It seems like this should really be a perfect fit for this sort of use-case, and I'd hope the memory footprint and speed are all much more competitive than HTML-based approaches.

The team I'm currently working with are using Gotenberg for things which we can afford to take a little while, and C#/Skia for things which need to be reasonably quick.

[+] film42|8 months ago|reply
Thanks for your comment! I have a few PDFs that I need to generate for groups of users every so often and since wkhtmltopdf is considered EOL, I've been forced to use chrome (which sucks to manage). I just rewrote that code to use Typst (via the typst gem) and it's so so so much better.
[+] pityJuke|8 months ago|reply
Glad to hear Typst has people doing serious work with it.

I’ve been able to avoid LaTeX. At uni, I went for org-mode -> LaTeX, which was OK except when my .emacs file was filling up with LaTeX stuff to make random stuff work. To be honest, that means I probably can’t even compile it again if I wanted to.

Typst has been awesome (always ran into LaTeX just being horribly inconsistent when layout stuff) when I’ve used it. Hope it continues.

[+] veunes|8 months ago|reply
Typst really does feel refreshing in that sense… way less fiddly and a lot more predictable, especially for layout tweaks
[+] msravi|8 months ago|reply
I have only two peeves with typst.

1. They should have carried forward the latex standard as-is for math, instead of getting rid of the backslash escape sequence, etc.

2. There is no way to share a variable across a file's scope - so can't have a setting that is shared across files - not even with state variables.

Other than this, typst is solid, and with the neovim editor and tinymist lsp, is great to write with.

[+] CodesInChaos|8 months ago|reply
Generally Typst looks like a significant improvment over LaTeX to me. The language is cleaner and easier to understand, and the first class scripting support is appealing. Its embeddability and templating features make it an interesting option for automated PDF generation (e.g. invoices) as well.

However its handling of introspection and convergence gives me a bad feeling.

[+] freehorse|8 months ago|reply
What deters me from Typst is that latex math syntax is nowadays ubiquitous. You write $x^2=1$ and it renders in many places. Learning a new syntax for math expressions is simply not in my interests.
[+] Bayes7|8 months ago|reply
| „[…] was a friend telling me his LaTeX thesis took 90 seconds to compile towards the end“

Sure, but in order to iterate you won’t have to compile the whole document but can just keep the chapter you are working on by structuring it with \includes

[+] cbondurant|8 months ago|reply
The initial motivation of LaTeX compile times being slow is very interesting to me.

I use LaTeX as a tool for layout of books to print for hobby bookbinding and my current project - a 3 megabyte, 500k word beast of a novel - only takes around 10 seconds to compile.

I cant imagine what the friend of the author here had going on in his paper such that his compile times took such a hit. Required use of specific LaTeX libraries dictated by the journals he was submitting to that were written inefficiently? specific LaTeX features or packages that end up hitting significantly slower codepaths?

Makes me wonder if its not LaTeX itself that is the speed issue but instead the very maturity of the ecosystem that it has as advantage over Typst. It could entirely be possible that once Typst has the wide berth of features and functionality available through its ecosystem, that it would become just as easy to fall into compile time tarpits.

[+] poulpy123|8 months ago|reply
I tried typst a year ago, and I found it really nice to use compared to Latex. I even managed to make (or modify I don't remember) a small module to customize boxes, something I would not have even though of trying with latex.

I don't use latex anymore and I don't have a use case for typst, so I'm not currently using it, but I follow the advancements from time to time, and I have to disagree with the advisor.

Typst is perfectly fine for replacing latex in almost any place that doesn't require the latex source. The other case is because tthe ecosystem is much smaller so if you need a specific extension that does not exist or is not trivial to implement you'll be out of luck, and you'll be stuck with latex.

[+] fabiensanglard|8 months ago|reply
I am working with typst for my next book. This framework has been a dream. I am SO happy I never have to touch LateX again.
[+] tiagod|8 months ago|reply
I've used Typst to generate reports in multiple languages and it works pretty well for this! I just pass typst JSON with the report data and use it from there.
[+] lblume|8 months ago|reply
Especially in combination with file watching. Your script writes to the JSON file and the entire document and everything that depends on it updates automatically, often in less than a second.
[+] dleslie|8 months ago|reply
In thirty years LaTEX will still be open source and probably will be maintained.

Typst appears to be a mix of open source and closed source; the general model here tends to be neglecting the open source part and implementing critical features in the closed source portion. Which is to say, it's unlikely to live beyond the company itself.

[+] Svoka|8 months ago|reply
I'm quite glad some alternatives are popping up. Using LaTeX feels like piece of 80s tech to be honest. It is obviously fine and super powerful, but, like vim-style fine. There got to be more contemporary alternatives that status quo.

Not everyone is into nostalgia. I don't try to take away LaTeX or vim from anyone, it just not for everyone.

[+] commandersaki|8 months ago|reply
These are some notes I wrote when I started out with typst when comparing with LaTeX:

1. It doesn't generate 5 bloody files when compiling.

2. Compiling is instant.

3. Diagnostics are way easier to understand (sort of like Rust compiler suggestion style).

4. List items can be either - item1 - item2, etc. or [item1], [item2]. The latter is way better because you can use anchoring to match on the braces (like "%" in vim), which means navigating long item entries is much easier.

5. In latex you have the \document{...} where you can't specify macros so they need to be at the top, in Typst you can specify the macros close to where you need them.

6. It's easier to version control and diff, especially if you use semantic line breaks.

7. Changing page layout, margins, spacing between things, etc., footers with page counters, etc. just seems way easier to do.

[+] crossroadsguy|8 months ago|reply
I just want a a very simple Markdown like syntax to make a very basic resume with just few features that are not in Md:

- custom spacing - horizontal/vertical (after list dots/numbers etc as well)

- justifying the text

- custom margins

And for that something like this is an overkill. Less than Tex but still an overkill.

Hell, I can do with a flavoured markdown if it supports this.

[+] shrinks99|8 months ago|reply
Very cool! I ran into the multiple bibliography issue when attempting to typeset my grandmother's PHD thesis which I was able to rescue from the 5.25" floppies it was originally stored on. I was planning on waiting until they solved this officially to resume that side project, but might give Alexandria a shot!
[+] thezoq2|8 months ago|reply
That sounds like a fun project! Alexandria is the way to go for now but hopefully they will get proper support for it sooner rather than later.
[+] codeape|8 months ago|reply
From https://www.latex-project.org/about/:

"LaTeX is not a word processor! Instead, LaTeX encourages authors not to worry too much about the appearance of their documents but to concentrate on getting the right content."

IMO, the only people that use LaTeX are people who are willing to trade the convenience and productivity of using a sane document authoring format for the warm and fuzzy feeling you get when you use an outdated piece of typesetting software that is a) hard to configure, b) hard to use and c) produces output for the least useful reading platform available (paged pdfs).

And the pronounciation is stupid.

[+] JohnKemeny|8 months ago|reply
> IMO, the only people that use LaTeX are people who are willing to trade the convenience and productivity of using a sane document authoring format for the warm and fuzzy feeling [...]

I hope you are aware that literally all research in mathematics and computer science is typed up and published in LaTeX?

[+] lolinder|8 months ago|reply
Alternatively, they're people who write documents in a field where LaTeX is the standard, they're not computer savvy enough to try to even look for something new that might be acceptable or might compile to LaTeX, and at any rate they want to focus more on their research than they do on changing the typesetting norms in their field.

(No shade on people who do decide to use alternatives, and Typst is great!)

[+] OkayPhysicist|8 months ago|reply
The major selling point to me, is that I can write the content I want, in a rather straightforward manner, and then just apply whatever formatting is necessary. It makes a lot of sense in the context of, say, university, where you're taking multiple classes, which each use different formatting guidelines, but those formatting guidelines stay the same for the duration of the course. I could just figure out (either using existing formats, or by hand-rolling my own) a document type for each class, and then never think about formatting again, whereas with a word processor, you've got to keep in mind the arcane series of steps necessary format your document in whatever style you require, and then pray that any modifications you make don't break the formatting.

The other place it's useful is heavily typeset documents, especially those subject to somewhat frequent modification, like a resume.

[+] tiffanyh|8 months ago|reply
Do you feel the same about Markdown?

Just curious.