Cheat sheet to convert LaTeX to Typst

I’m beginning to use Typst more and more often, but I’m coming from more than 10 years of LaTeX usage, and I guess I’m not the only one in this situation :)

So I have many reflex to do things that are not working in Typst.

My question is : is there a page somewhere in the documentation (or on the Internet) that would give a kind of exhaustive equivalent cheat sheet to make conversion, and that would be updated by the users after they discover how to do it ?

There is this page with basic comparison (and other on existing on the web)
For instance, I just opened a topic about an equivalent of the keyword oversize in tcolorbox (quite specific !).

If this platform is not yet existing, maybe it should somehow be created ? I would gladly add some information on it !

Well, this is not a cheat sheet, but typst/typst | DeepWiki might be helpful. For example, Search | DeepWiki answers that specific question.

AI has the general knowledge about LaTeX, and DeepWiki has access to Typst’s git repo (containing both the implementation and the docs). Therefore, it can answer most questions about something that you don’t know the name.


Some projects listed in :books: Documentation | Best of Typst (TCDM) are similar to what you want: GitHub - johanvx/typst-undergradmath: A Typst port of undergradmath · GitHub, GitHub - mewmew/typst-cheat-sheet: Typst cheat sheet. · GitHub, etc.
However, they are not quite comprehensive at present.

2 Likes

For converting LaTeX documents to Typst, I have found Claude Code very capable. It gets a few things wrong at first. I put those into a rules file to fix them.

For very specific Typst how-to questions, Claude is also likely your best option.
A cheat sheet would have to be enormous to cover a significant fraction of all cases.

Once Claude has figured out the answer to a specific question, you can ask it to write that to the rules file. So you don’t have to remember the answer yourself.

Agreed that AI is very good for this. I’ve been using Gemini (happen to have a workspace subscription) and it has worked very well for either
(a) producing equivalents to LaTeX functions, or just generally
(b) solving raw Typst problems/providing function code.

Thanks for your answers ! AI tools seems indeed to be quite useful in this case.

The main drawback I see is that all the AI answers will be kept private on our account so if someone else have the same question in the future, he/she might ask the same thing to the AI…

(I’m no anti-AI and I use it, but I know its huge energetic impact it has, so I try to reduce my usage :sweat_smile:)

2 Likes

Well, AI can solve that problem as well. When you ask it how to solve a problem, also ask it to add the answer into some kind of structured documentation that you can post online. The same can be done when Claude writes new documents. You can set up a rule that asks it to write anything it learned while writing (that seems useful for future writing) into the same documentation.
The benefit of that is that Claude won’t have to look up the same problem over and over again. It can consult its own documentation instad and save time and tokens.
The key is to set up good rules, so that these things are automatic.

I tried @Johannes_Brandenburg’s Typst MCP Server once to convert older LaTeX projects to Typst projects[1]. While it handled standard typesetting fairly well, it still required significant manual layout adjustments, as LaTeX and Typst differ fundamentally in that regard.

In the end, I try to avoid porting entire LaTeX projects to Typst and instead rewrite them from scratch within the Typst ecosystem, with only (semi-)automatic conversion of the content, sometimes with the help of LLMs, as others have already suggested.


  1. See also the forum thread LLM code generation? - #12 by Johannes_Brandenburg ↩︎

I’ll note that pandoc --wrap=none -t typst does a very credible job of converting your LaTeX document to a Typst file. Though it does fail to transform some advanced techniques and the resulting Typst isn’t quite idiomatic. It’s also perfectly useless for Tikz or pstricks diagrams, I don’t know how good a job Claude could do in those case either.

Advantage : It is perfectly deterministic, no hallucination or attempt by the LLM to answer one of the question your document asked… or to accomplish something your document suggested (no command injection vulnerability in other words).
In addition, for those that are concerned about that, it is way less resource hungry (by several orders of magnitude).

Disadvantage : A bit more effort afterward to get to an usable Typst result maybe?

1 Like