Deactivate numbering in grid?

I’m working with a 10×2 grid in Typst where both columns are left-aligned. However, some text elements in the rows begin with a number followed by a dot (e.g., 31. September), and Typst automatically interprets these as numbered list items, causing unwanted indentation.

My goal: I want all text to remain fully left-aligned, without Typst treating these entries as lists.

Important constraints:

  • I need a global solution—either for the entire grid, grid-column, or ideally the whole document.
  • Manually escaping or formatting entries like 31. is not viable, as the content will be dynamically generated from a database. I won’t know in advance which entries start with numbers.

Question:
Is there a way to disable automatic list recognition globally in Typst, or at least within a grid or column?

#show grid.cell.where(x:0): set text(weight: "bold")
#grid(
  columns: (1fr, 2fr),
  align: (left, left),
  row-gutter: 5mm,
  column-gutter: 2mm,
  [Title], [Info],
  [Title], [31. September longer Info text may span over multiple lines which shows the described issue of body indent],
  [...], [...]
)

Well, I think escaping is the best solution. If the code is generated, you can replace the content with a string, like "31. September…".

2 Likes

I wouldn’t recommend generating Typst markup from code. Rather, turn your data into JSON and read/parse that from Typst with the json function. You can also uses sys.inputs to populate that data. It will be much more robust and easier to maintain.

1 Like

Is it viable to escape periods? Using 31\. in markup will work, that is, backslash-escaping every period (in markup only, not in code).