home / blog

i don't use latex (anymore)

~ May 18, 2025

In high school I once had to write up a 20-page lab report my physics class. I had two options: I could write it all by hand, but this was slow, messy, and difficult to keep track of digitally. Or I could type it out in Google Docs, which was also slow, but looked neater and I could keep a digital pdf of the lab on my computer. I really liked the way math equations and regular text fit together in a digital document, but I hated how clumbersome it was to insert an equation in Google Docs by clicking through the visual equation editor. I needed a solution that could let me write regular text as fast as in Google Docs, but math symbols as fast as I could by hand. It was when researching for this lab when I first stumbled across LaTeX.

LaTeX seemed like the perfect solution to all my problems at the time. It got me through the remainder of high school, where using it I was able to crank out lab reports and other mathematical documents in a fraction of the time it took my classmates to do by hand or on Google Docs. (My physics teacher complimented my lab in front of the class, asking me if I had LaTeXed it, to which I proudly responded “yes!”.) I even typed out all of my AP Calculus BC notes in LaTeX. Come university, I found out that we were encouraged to use LaTeX for assignments, and I was more glad than ever that I had already taught myself this language in high school.

During my second term, I decided to type-set my Math 146/148 notes. I would go to lectures and write notes by hand, then transfer them to LaTeX some time later in the evening. But it was during this repetitive process that I really started wishing for a better tool. Not only was LaTeX syntax sometimes unintuitive and bloated, the compiler was ridicolously slow for large documents, and my right hand hurt from spamming the \ key. I tried a bunch of workarounds to make my workflow more efficient.

  • For example, I really hated the syntax for a fraction. So I set up a crazy regex-matching, pattern-detecting, bracket-closing macro for turning x / y into \frac{x}{y}.

  • Then I found the syntax for making a bullet list cumbersome, so I set up an equally convoluted macro for turning

    - item 1
    - item 2

    into

    \begin{itemize}
      \item item 1
      \item item 2
    \end{itemize}

The syntax for defining logic and custom macros in LaTeX is also extremely unintuitive, as the language was released in the 1980s without such capabilities in mind. I tried looking into tools like SageTeX, but these only made my workflow more unecessarily complicated.

the alternative

At the start of my third term of university, one of my TAs introduced me to Typst, a modern LaTeX alternative, which was blazing-fast and written in Rust. At first, it looked like a half-cooked markdown alternative with embedded JavaScript. But I decided to give it a shot by writing an assignment in it.

Jump to present day, I have written over 12,000 lines of Typst. Here are the statistics from my school folder:

--------------------------------------------------
Language     files     blank     comment      code
--------------------------------------------------
TeX             97      3921         490     21653
Typst           46      2481         294     12571
Racket         124      1478        2597     11518
C++             94      1338         481      7049

I’ve fallen in love with Typst and have entirely removed LaTeX from my school workflow. I’ve listed below a few reasons for why.

compilation speed

The LaTeX compiler is notoriously slow. In fact (at least for pdflatex which was the LaTeX compiler I used), you had to pass a LaTeX file through the compiler 3 times for there to actually be a PDF output. And not to mention it was slow and an energy hog. For context, I personal laptop is an M2 MacBook Pro which normally has over a day’s worth of battery life and I rarely have to plug it in while working. But when I was compiling LaTeX over and over again, my battery drained so quickly and forced me to sit next to an outlet. While I’m not the most educated in LaTeX compilers, I would have to guess this has something to do with LaTeX simply being a macro-expanding tool rather than an actual programming language that is compiled.

This is in contrast to the Typst compiler, which is written in Rust and uses a proprietary memoized compiler. For this reason, live previews of your Typst document are real-time, and compilations are super snappy. Also it doesn’t drain my battery :).

syntax simplicity

Probably the most memorable features of LaTeX syntax, whether for better or worst, is its usage of the backslash character \. However, over time I’ve found that my hand started to hurt from spamming the \ key thousands of times while typing up a document. Every little symbol needed a backslash, and it doesn’t help that the key is placed so inconveniently on the keyboard. This is because everything is a macro, and the compiler can only expand macros.

This is in contrast to Typst, which in my opinion has a much nicer and intuitive math syntax.

  • Instead of \frac{3 + 4}{2} you can just type (3 + 4) / 2.
  • Instead of \mathbb{R} you can just type RR.
  • Instead of a \neq b you can just type a != b.
  • Instead of \gamma you can just type gamma (one less character adds up over time!).
  • Instead of \rightarrow you can just type ->.
  • Instead of \left( \frac{a}{b} \right) you can just type (a/b) (for correctly sized brackets).

Not to mention, the symbols’ syntax in Typst is designed in such a way that similar symbols are all derivatives of a common base symbol. For example, in latex the following symbols: \subset, \subseteq, ⊈\not\subseteq, \subsetneq are respectively \subset, \subseteq, \nsubseteq and \subsetneq. It can be rather confusing to memorize where to put the negation of the symbol (before or after the macro?). This is opposed to Typst where they are respectively subset, subset.eq, subset.eq.not and subset.neq. Notice that they are all deriving from the subset symbol, which can make it easier to infer what the command for a new symbol is.

scripting

One of the biggest drawbacks of LaTeX is its lack of support for scripting. Just look at this post from the TeX stack exchange explaining how to implement the logical OR operator for an if statement.

\ifnum\ifnum\x=1 1\else\ifnum\x=14 1\else0\fi\fi
  =1 %
  <do this>
\else
  <do that>
\fi

And not to mention it’s limited support for iteration, which only comes when importing a third party package.

Typst has a scripting language very similar to JavaScript built right in. The syntax is very intuitive for anyone who has worked in any other programming language before, and is flexible enough to let you modify how elements are rendered. For example, for my data structures course assignment I needed a table with all suffixes of a given string, in sorted order. I could have wrote a quick Python script to print all suffixes for me, then copy them over to a LaTeX document. Or I could have just written a Typst script that did the logic and rendering all in one:

#let order = ("$": 0, "#": 1, "A": 2, "C": 3, "G": 4, "T": 5)

#let C = "AT#CGGAA$"
#let suffixes = (
    ..for i in range(C.len()) {
    ((i, C.slice(i)),)
    }
).sorted(key: ele => {
    let (i, suff) = ele
    (..for c in suff {(order.at(c),)})
})

#table(
    columns: (auto, auto, auto),
    align: (center, center, left),
    $i$, $S[i]$, [corresponding substring],
    ..for (i, (Si, suff)) in suffixes.enumerate() {
    ($#i$, $#Si$, $#suff$)
    }
)

And here’s the table:

suffixes table from typst

The addition of scripting creates many possibilities for reusability.

package manager

When I installed LaTeX on my laptop through MacTeX, the only option was to install not just the compiler, but also literally every package in existence. Most of these I would probably not use, but the installation came out to over six gigabytes. Not to mention the impossible to read documentation for the packages. The documentation for amsmath, one of the most popular and widely used packages, is a literal 44 page pdf. Also, if I wanted to use some package or template I found online, I would have to download all of its files and put them in the same directory as my .tex file. This is, needless to say, very cumbersome.

Meanwhile, Typst is a much more modern system which was built when package managers were widespread and popular. Its package manager, Universe, lets you simply import a package into your file by adding a single line at the preamble, without having to download anything manually.

final remarks

While LaTeX is probably a notable contributor to why I decided to study math in the first place – teaching me about the beauties of type-set math in high school – my time with it is over. Every system will eventually become outdated, and it’s just an inconvenience to try and stick to using them. I see a bright future for Typst and I’m glad to have adopted it so early.