The following line causes a linebreak?
- #strike([09. Juni 2025]) Pfingstmontag
“Pfingstmontag” ist indented below the date, which is a list item.
The following line causes a linebreak?
- #strike([09. Juni 2025]) Pfingstmontag
“Pfingstmontag” ist indented below the date, which is a list item.
An even more minimal reproduction is the following:
- #[09. Juni 2025] Pfingstmontag
A hint that something’s wrong here is that the text says “9. Juni”, not “09. Juni”. Apparently, the content block #[...]
or alternatively strike()
causes the 09.
to be interpreted as the start of an enumerated list! Maybe someone from the team can comment on whether that is considered a bug or not.
There are a few ways you can prevent this from happening:
- #strike[\09. Juni 2025] Pfingstmontag
- #strike("09. Juni 2025") Pfingstmontag
Personally, I would use the datetime
type combined with the datify
package to localize month names:
#import "@preview/datify:0.1.2": custom-date-format
#set text(lang: "de")
#let format-date(date) = context custom-date-format(date, "DD. Month YYYY", text.lang)
- #strike(format-date(datetime(year: 2025, month: 12, day: 9))) Pfingstmontag
// or, if you type the dates manually and don't want to use the long datetime constructor:
#let format-date(date) = {
let date = toml.decode("date = " + date).date
context custom-date-format(date, "DD. Month YYYY", text.lang)
}
- #strike(format-date("2025-12-09")) Pfingstmontag
Great answer. You got the eyes of an eagle! It did not occur to me that it could have been the start of an enumeration. In ‘regular’ markup I might have caught it but as typst uses ‘+’ I did not think of it. Although I had read at some time that enumerations could be skipped/restarted etc.