www-gem words

A new typesetting system: Typst

Published on

Have you ever heard about Typst ? Personally, I first encountered it a few months ago, but didn’t try it until very recently. In the past, I used LaTeX to create quite advanced scientific documents. However, after some time not using it, I had forgotten about its somewhat challenging code. Today, I use Groff — while it may be overkill because it’s capable of much more than I currently need — it was easier to use from scratch.

Then came Typst, which is the new contender in the world of document formatting. Overall, it can achieve the same things as its predecessors while introducing an even easier way of formatting your documents. After resisting the urge to test it for months, I finally gave it a try and eventually adopted it as my go-to typesetting tool.

╭── Quick comparison to LaTeX

LaTeX is probably the most famous typesetting system out there, especially among academics, scientists, and engineers. It’s incredibly powerful for handling complex mathematical equations, bibliographies, and large documents. But LaTeX is also known for its steep learning curve, cryptic syntax, and an often daunting experience for beginners.

Typst, on the other hand, takes a more intuitive approach, and is designed to be more user-friendly, with a syntax that feels much more like natural language.

Here is a text example:

In LaTeX

\documentclass[twocolumn,11pt]{article}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{tcolorbox}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}

\title{\textbf{Example in \LaTeX}}
\begin{tcolorbox}[colback=blue!5!white, colframe=blue!75!black, title=Math Highlight]
The famous Euler identity:
\begin{equation}
e^{i\pi} + 1 = 0
\end{equation}
combines five fundamental constants.
\end{tcolorbox}

In Typst

#set page(width: 210mm, height: 297mm, margin: 25mm)
#set text(size: 11pt)
#set heading(numbering: "1.")

#align(center)[
  = *Example in Typst*
]

#box(fill: luma(95%), stroke: blue, inset: 1em)[
#heading(2)[Math Highlight]
The famous Euler identity:

$ e^{i\pi} + 1 = 0 $

Here is a table example:

In LaTeX

\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs} % for prettier tables
\begin{document}

\begin{tabular}{|c|c|c|}
\hline
\multicolumn{3}{|c|}{\textbf{Sales Report}} \\ \hline
\textbf{Region} & \textbf{Product} & \textbf{Revenue} \\ \hline
\multirow{2}{*}{North} & Apples  & \$1,200 \\ \cline{2-3}
                       & Oranges & \$900  \\ \hline
\multirow{2}{*}{South} & Apples  & \$1,500 \\ \cline{2-3}
                       & Oranges & \$1,100 \\ \hline
\multicolumn{3}{|c|}{\textbf{Total: \$4,700}} \\ \hline
\end{tabular}

\end{document}

In Typst

#table(
  columns: 3,
  [
    [colspan: 3][*Sales Report*],
    [*Region*, *Product*, *Revenue*],
    [rowspan: 2][North], [Apples], [$1,200],
    [Oranges], [$900],
    [rowspan: 2][South], [Apples], [$1,500],
    [Oranges], [$1,100],
    [colspan: 3][*Total: $4,700*],
  ],
  align: center,
  stroke: 0.5pt,
)

The end result will look like:

A table structured with 3 cells merged/collapsed horizontally on first and last rows, and 2 cells merged/collapsed vertically on row 3 and 4

Note the 3 cells merged/collapsed horizontally on first and last rows, and the 2 cells merged/collapsed vertically on row 3 and 4

Typst eliminates the need for overly verbose and complex command structure. Instead of having to worry about creating a preamble, specifying document classes, or dealing with conflicting packages, Typst’s syntax is minimal and readable right from the get-go.

╭── Quick comparison to Groff

Groff is often used in Unix environments and is known for its ability to generate man pages and simple documents, but it’s also widely used for technical documentation.

Groff also has its own unique syntax and is more focused on low-level formatting, giving you a lot of control over the output. However, this comes at the cost of convenience. Groff doesn’t have the same rich ecosystem of pre-built templates and tools as LaTeX or Typst.

Notably, its syntax is more cryptic than Typst’s, and if you want to do anything more complex, you’re often required to write your own macros or scripts.

In contrast, Typst is much more approachable, even for beginners, and still provides enough power to create sophisticated documents. It’s designed to make complex tasks easier—whether that’s writing academic papers, reports, or even books—without needing to be an expert in typesetting.

╭── What Typst really brings to the game

Simplicity and Readability

Typst’s syntax is designed to be readable and user-friendly. The layout is intuitive, and you don’t need to know a ton of complicated syntax to get started. Whether you’re writing a simple report or a complex document, Typst allows you to focus on your content, not the formatting.
Typst also takes advantage of modern programming principles and makes it easier to learn and more adaptable to newer workflows, including integration with tools like Git.

Automatic Design

One of Typst’s standout features is how it handles document design. While you can customize everything using simple syntax, if you don’t specify any settings, it will generate documents with default font sizes, line spacing, and header styles.

Built-in Support for Graphics

Typst makes it incredibly easy to integrate graphics into your document, whether it’s images or vector graphics. The syntax for adding and manipulating graphics is simple and clean, which is a big plus if you’re working with visual elements in your documents.

Rich Documentation

Typst comes with extensive documentation and examples, which helps you learn the system quickly. Even if you’re not a designer, you can quickly create high-quality output without needing to know much about typography or page layout.

Collaboration Ready

Because Typst is text-based and open-source, it’s easy to version control your documents with Git, making it a great tool for collaborative projects. Whether you’re working with a team of writers, designers, or developers, Typst makes collaboration seamless.

╭── You’re still reading?

Overall, Typst brings a fresh, modern approach to document typesetting. It caters to writers of all levels, from beginners to experienced professionals.
Its strength lies in offering a more intuitive and streamlined interface, emphasizing simplicity, automation, and contemporary design principles. I’d say it’s definitely a tool worth exploring.

If you’ve struggled with LaTeX or Groff in the past, or if you’re simply looking for something more flexible and easier to use, Typst might be the perfect fit for your next project.


More food for thoughts? Check other posts about: #System


Thanks for your read. Hope it's been useful to you.


Interact with this post using Mastodon or

Comment on wwwgem's post

Copy and paste this URL into the search field of your favourite Fediverse app or the web interface of your Mastodon server.

✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈