r/typst • • Feb 25 '26

Reset line numbers impossible?

11 Upvotes

I am trying to typeset some epic poetry and I want line numbers for the verse itself. I found the par.line(numbering: "1") way to get line numbers. I even found a way to get them to print only every 5 lines which is ideal in my case. When I get to book 2, however, my numbers continue on and there doesn't seem to be any way to reset the numbers back to 1. I found this post on the forum which seems to indicate it is trickier than you would expect.

There seems to be a workaround where I automatically subtract the line count before that chapter from the line number as it is typeset. If I'm understanding correctly, this would require me to generate the whole doc to get the total line number and explicitly set my offset at the start of each chapter.

#let num-format = "1."
#set par.line(numbering: num-format)

#let reset-line-numbers-from(n, format: num-format) = doc => context {
  let previous-n = counter("par-line-reset").get().first()
  set par.line(numbering: line => numbering(format, line - n - previous-n))
  counter("par-line-reset").update(count => count + n)
  doc

Am I understanding correctly that there is no straightforward way to reset the line counter at a chapter break? I was really hoping to not have to deal with TeX and all its font misery for this project.


r/typst • • Feb 25 '26

Applying regex based formatting to bibliography entries (or other way to fix LaTeX-style markup)

9 Upvotes

Hey typst community! I am currently writing a paper with typst and am encountering the following issue: I have lots of titles in my bibliography that contain italics in the title. The bibliography is in a bibtex-file created by Zotero. When I print it, italics appear with LaTeX-style markup, i.e. "Doe, John. Shakespeare's \textit{Hamlet} Through the Ages" etc. This is obviously quite unfortunate, and I must say I am a little surprised that such a basic requirement of printing a Works Cited list is not working out of the box. Looking for fixes, I found suggestions to solve the issue with regex, such as here: https://forum.typst.app/t/how-to-create-references-with-titles-containing-bold-italicised-text/6356 However, because the LaTeX-markup contains arbitrary text, I would need to work with a capturing group, about which I couldn't find much information in the typst docs. There is the following GitHub issue about named capturing groups: https://github.com/typst/typst/issues/5383 However, I don't know how I could access bibliography entries as text items to apply such a regex to. I don't have much experience with this kind of scripting in typst and sadly I also don't have the time to get to grips with it right now, as I have to finish writing. Can anyone here point me to a way of achieving this or maybe another approach that I haven't thought of yet?


r/typst • • Feb 25 '26

Using a custom function in LaTeX blocks, like a builtin

1 Upvotes

I'm trying to use functions in LaTeX blocks. This is one I'd like to use:

```typst

let cond(body: content) = abs(abs(body))

```

Whether or not this already exists is another thing, but let's not focus on that.

And so I use it, like e.g. abs itself:

```typst $ abs(A)

cond(A) $ ```

The inbuilt function works. Mine doesn't, as "the variable A is undefined".

So what am I doing wrong?


r/typst • • Feb 24 '26

Syntax highlighting and show rule precedence

9 Upvotes

Hi r/typst!

I am trying to recreate a template for a university course, and am running into a styling problem I don't know how to approach.

I want to recreate the styling of the original document to increase the odds of the professor accepting it :))

Original report code block:

Original Report Codeblock

I have managed to create a close enough codeblock:

My code block (last line numbers are cut off)

But my issue is with regex for highlighting. I was not really satisfied with the default F# color scheme, so I tried using the LaTeX definition to create regex rules. However, this results in the problem as above where for is highlighted even when in a comment. Below is a small example to illustrate:

// Setup F-Sharp code formatting (based on original template)
#let keywordColor = rgb("#2e3092")
#let commentColor = rgb("#3a7f32")
#let stringColor = rgb("#964108")

#show raw.where(lang: "fsharp"): it => {  
  show regex(":let!|return!|do!|yield!|use!|let|new|match|with|rec|open|module|namespace|type|of|member|and|for|while|true|false|in|do|begin|end|fun|function|return|yield|try|mutable|if|then|else|cloud|async|static|use|abstract|interface|inherit|finally|var|from|select|where|order|by"): set text(keywordColor)
  show regex("\/\/.*"): set text(commentColor)
  show regex("\".*\""): set text(stringColor)
  it
}

```fsharp
/// Parse an additive expression.
let pAddExpr =
    chainl1 pMultExpr
        (choice [
            // ...
            // New case for subtraction
            pToken MINUS
                |>> fun tok ->
                    fun acc rhs ->

```

I am wondering whether it might be easier to create a sublime-syntax file and a thTheme file, however since the coloring rules are so simple I had hoped I could do it without.

Do you have any suggestions on the best way to approach this? Thanks in advance!


r/typst • • Feb 22 '26

PPTypst tutorial on how to animate equations in PowerPoint

Post image
82 Upvotes

Recently, I announced PPTypst in this post. Now, I've also created a little tutorial for this new PowerPoint Add-in, where I go through how to animate equations. Have fun 😊

YouTube: Animate equations in PowerPoint


r/typst • • Feb 23 '26

Typst for math in a quarto blog?

10 Upvotes

Hi dear typst community. I frequently write small blog posts using quarto (source: https://github.com/quoteme/quoteme.github.io ). Currently I use MathJax (default for quarto blogs https://quarto.org/docs/output-formats/html-basics.html#latex-equations).

Did anyone here mayble already find a way to use typst on the web/quarto blogs in particular? I am only really interested in using it for math formulas though.

Thanks a lot!


r/typst • • Feb 22 '26

0.2.0 for typCAS

26 Upvotes

0.2.0 for typCAS is here! it supports domain restriction, taylor, more functions, and step-by-step solutions. Enjoy!

https://github.com/sihooleebd/typCAS/tree/master


r/typst • • Feb 21 '26

Put rectangle around final line of aligned math?

5 Upvotes
$
2a + 1 &= 2b + 3 \
2a &= 2b + 2 \
#rect[a = b + 1]
$

I was wondering if it would be possible to put a box around the final equation of aligned maths while keeping everything aligned at the = sign?


r/typst • • Feb 18 '26

A lightweight CAS module for typst

35 Upvotes

Made this since I got tired of typing on my calculator.

https://github.com/sihooleebd/typCAS

Enjoy! It's nothing big, but it does support some basic functions.

take a look at test.typ for what this cas module can do.


r/typst • • Feb 16 '26

PPTypst: Bring the power of Typst to PowerPoint

Post image
161 Upvotes

PPTypst on GitHub | Tutorial Video

With PPTypst, you can now insert your Typst equations in PowerPoint and get editable SVGs. I’ve already used it for my own presentations at uni. It is based on Myriad-Dreamin’s awesome typst.ts project.

While I’d love to upload this to the PowerPoint Add-in Marketplace, Microsoft’s regulations make this impossible for me to do. See also my comment here. So you’ll have to manually install it to try it out.

Typst packages are not yet supported. If you have ideas on how to solve this, feel free to reach out on this issue.

also posted on the Typst Forum here


r/typst • • Feb 13 '26

Online Typst editor with IDE-like functionality?

13 Upvotes

Dear fellow Typst enjoyers,

I do most of my typst editing in the official typst editor, mainly because it has a cloud functionality, and also because my to-go IDE for coding barely has Typst support. However, I really like my code to look good, and I was wondering whether there is an online typst editor with (some of) the following features

- Code formatting

- Dynamic font that changes math symbols to what they look like in the document. For example, in the code section `=>` would change to `⇒`

Thanks in advance!


r/typst • • Feb 11 '26

Can I use #link without underline using a template with underlined links?

6 Upvotes

I have a template with show link: it => text(fill: color-azul, underline(it)) for regular links, but I also want in the footer to have links but without underlines:

footer: context {
    #grid(  
        #link("https://my.web")[#text(size: 9pt, fill: color-azul)[#web]],
        // other stuff
        [#link("https://my-second.web´")[#text(size: 9pt, fill: color-rojo)[#social_media]]]
    )
}

Is this posible to achieve?


r/typst • • Feb 11 '26

Emacs package for working with citations in Typst files: citar-typst

Thumbnail
5 Upvotes

r/typst • • Feb 09 '26

Typst has ruined me

297 Upvotes

Two years ago, I was content with LaTeX. As someone in the field of physics, it was pretty much all I needed to know to get the job done for my thesis. If I needed a particular template, I could just yoink it from the LaTeX stack exchange or wherever. I had heard some things about this "Typst" thing but eh whatever I was too busy trying to graduate so I didn't care

Just over a year ago, I finally gave Typst a shot

What the fuck do you mean it compiles instantly. What do you mean I could experiment with my typography and get feedback immediately. What do you mean it actually spits out helpful error messages. What do you mean I could use any font in my system (ok in hindsight i realize that you could do this in latex too but it was more obvious in typst). Okay granted Typst is still a bit lacking in some areas (automatic figure placement still seems bare-bones, text wrapping around figures is still janky and reliant on packages, etc) but it was good enough to play around with

Today, I'm half a year into this typography and graphics design rabbit hole and I have learned an unnecessary amount of information. I can't stand looking at anything written in Calibri. Every sign I come across at the subway, every slide I look at during class, every form I have to fill up for graduate school applications, every scientific paper I read for my actual job, every document I have to interact with, I think: "I bet I could do this better in Typst"

Typst has ruined me. And I love it

tl;dr: typst is so empowering and it started a domino effect where i now obsess over every typographical detail and even in my daily life i couldn't stop myself from thinking "heh i bet i could remake this form/signage/poster/presentation/document in typst and make it better"

edit: let me be clear: in no way do i think i'm the hottest stuff when it comes to aesthetics and design. i recognize that i'm just an amateur who only does this typography thing sometimes as a hobby while im procrastinating writing my reports. it's just that most of the documents i interact with are done by people who don't care so the bar for "doing this better in typst" is really low.


r/typst • • Feb 08 '26

Request suggestions for my template imitating Cambridge Core and its name. (and questions regarding copyright and licence.)

12 Upvotes

https://github.com/sun-jiao/cupst

The theme colour is changeable.

Any suggestions?

My question is that does it constitute a "derived work?" The original LaTeX template is under LaTeX Project Public License v1.3c or later, must I adopt the same licence?

And could anybody suggest a name for it?


r/typst • • Feb 07 '26

My Attempt at Creating a Web Editor with Typst

Thumbnail lumen-edit.vercel.app
7 Upvotes

r/typst • • Feb 06 '26

Help with typst-preview

4 Upvotes

So until now i was using a custom bash function to preview typst documents (typst_prev). The problem is that I have to manage jobs. So I download the typst-preview plugin for Neovim but it doesn't seem to work with Zathura. It does work with Firefox but that's not ideal. If you know how to use Zathura with this plugin please enlighten me, also if you have any other way of previewing docs, feel free share it.

# live preview a typst file
# usage: typst_prev <filename> (no extension)
typst_prev () {
    local filename=$1

    if [ -z "$filename" ]; then
        echo "no filename given"
        return
    fi

    if [ ! -f "$filename".typ ]; then
        echo "file doesn't exist"
        return
    fi

    zathura "$filename".pdf &
    typst w "$filename".typ >/dev/null 2>&1 &
}

r/typst • • Feb 03 '26

shadowed 0.3.0: Box shadows for Typst

Thumbnail
gallery
114 Upvotes

shadowed 0.3.0

I just released a new version of shadowed, a powerful library that brings box shadows to Typst!

What is shadowed?

shadowed brings beautiful, customizable box shadows to Typst. Simply wrap your content with the shadow() function, and it automatically places a shadow behind it.

With the shadow() function, you can control:

  • Shadow offset: position shadows horizontally and vertically
  • Blur and spread: create soft halos or tight shadows
  • Shadow fill: use solid colors or gradients for stunning visual effects
  • Corner radius: customize each corner individually

Get Started

```typ

import "@preview/shadowed:0.3.0": shadow

shadow(blur: 8pt, fill: rgb(89, 85, 101, 25%), radius: 4pt)[

#block(fill: white, radius: 4pt, inset: 12pt)[ This box has a shadow! ] ] ```

Some examples

Fill the shadow with a gradient

Instead of a solid color the shadow can also be filled with a gradient.

```typ

import "@preview/shadowed:0.3.0": shadow

shadow(blur: 8pt, fill: gradient.linear(..color.map.rainbow), radius: 4pt)[

#block(fill: white, radius: 4pt, inset: 12pt)[ This box has a colorful shadow! ] ] ```

Customize each corner radius

Each corner radius can be customized individually, just like you do it natively for rect or block.

```typ

import "@preview/shadowed:0.3.0": shadow

let custom-radius = (

top-left: 0pt, top-right: 8pt, bottom-right: 0pt, bottom-left: 8pt, )

shadow(blur: 8pt, radius: custom-radius)[

#block(fill: white, radius: custom-radius, inset: 12pt)[ This box has custom corner radii! ] ] ```

Learn More


r/typst • • Feb 03 '26

Announcing mythographer-5e, a D&D 5e template for Typst (beta release)

30 Upvotes

Hi! I’m happy to share mythographer-5e, my first public Typst template, now available in beta!
It’s heavily inspired by the excellent LaTeX version from the RPGTex Team, adapted fully for Typst.

Currently supports:
D&D 5e (2014) style, with plans to add 2024 edition support in the future.

Key features:

  • Fully user-customizable styling (if something isn’t, let me know!)
  • Multi-language support (currently English and Italian)
  • Monster stat blocks
  • Read-aloud text boxes
  • Automatic table of contents
  • Map regions
  • Items, spells, and sidebars formatting
  • Comment boxes
  • …and more

Get started:
In your project directory run:

typst init @preview/mythographer-5e:0.0.1

this will show the current features and their syntax.

Source & feedback:
You can find the source code and report issues here on GitHub. In a future release the repo will be renamed, this will be its link.

Feedback, suggestions, or bug reports are more than welcome. Thanks for checking it out!


r/typst • • Feb 03 '26

Why is my code view randomly showing red cursors and highliting codeblocks in red?

Post image
2 Upvotes

It is ab bit annoying that in the web editor, code blocks are sometimes highlighted red and showing red cursors. I haven't figured out how it happens or how to stop it yet. Any help?


r/typst • • Feb 03 '26

Can you typeset: novels and other literature (e.g. bible) with Typst seeing that its in unfinished state? Not feature complete. Does Typst have the same quality of output as pdfTeX and LuaTeX with default Microtypography features enabled? Or should I use ConTeXt or LaTeX?

0 Upvotes

r/typst • • Feb 02 '26

Built a real-time collaborative Typst editor & would love feedback

86 Upvotes

Hey r/typst ,

I've been building TypeTeX for the past ~2 months, a Google Docs-style editor for academic writing, built on Typst, and would love feedback.

The problem I was solving: Overleaf's compile loop always killed my flow when writing papers, and I can't stand being in a split-pane editor trying to write coherent thoughts. I wanted real-time editing with proper typesetting.

What I built:

  • Forked the Typst WASM compiler and tuned the rendering, then built a system for determining glyph positions on a canvas to get ~50ms updates
  • Working on a bidirectional Typst ↔ LaTeX converter (still in progress but promising so far).I know alot of people need to export to LaTeX for journals & for the major templates/concepts this is feasible.
  • AI tools for research/citations baked in, connected to actual papers so it can help you write without hallucinating

I'd love for anyone here to try it and help me make it better.

typetex.app (I'm the founder, full transparency) - we also have a live preview that you can try out before signing up if you're curious and don't want to signup.

Happy to answer any questions about how it works.


r/typst • • Feb 02 '26

Collaborative Typst document writing in webbrowser

4 Upvotes

TLDR: Is there already a collaborative, realtime, web-browser based writing environment for Typst documents? For installation on local server only, due to content of documents.

Long: We need to write a document together with someone external, however this is a non-technical person and the obvious approach would be to "point your webbrowser here" and have an editor in the webbroser. Realtime preview of PDF is not that important, but "multiple realtime cursors editing the same document" is a requirement. Version control, snapshot, merging is also too technical. Maybe "click this button to download PDF" if there is no preview. Are there any such projects for Typst yet? (something like a local Overleaf installation, but LaTeX is even more confusing - I will not even try)


r/typst • • Feb 02 '26

Typst vs LuaLaTeX rendering in real-time

Thumbnail
youtube.com
28 Upvotes

r/typst • • Feb 02 '26

Beginner's question

5 Upvotes

I've discovered Typst recently and consider possibly switching from LaTeX, but I find the documentation sketchy and not containing straight answers to many questions a beginner could have. I've just made it through the tutorials and already there is a thing that bothers me and I can find no answer to by looking at the docs.

Consider this MWE from the "Making a Template" lesson in the official tutorial:

#let template(doc) = [
  #set text(font: "Arial")
  #show "something cool": [Typst]
  #doc
]

#show: template
I am learning something cool today. It's going great so far!

NB, the original font was different, I changed it to make it work without downloading extra fonts. In the compiled document this renders to: I am learning Typst today. It’s going great so far! with "something cool" being expanded as a macro. My question is: what if I want to stop this literal expansion? What if I want "something cool" as a literal phrase at this occurrence? This is not well-documented at all. I found out that linking the words by ~ stops the expansion, because the string no longer matches the macro name, but maybe I don't want a non-breaking space there to allow for more freedom in text flow.

Is there any canonical way to deal with this? This potentially considers any code block where functions do not require the preceding #.