By writing $ x $
not indented by two spaces (i.e. the same amount as the - ...
starting the list) you’re exiting the list and start a new one. You can easily see that by replacing -
by +
and looking at the numbers.
So the fix is to indent the two lines:
- #lorem(10)
$ x $
#lorem(10)
- #lorem(10)
The problem is that the math will now be centered relative to the width of the list item, not of the page, but that can be fixed with a block with width: 100%
– see also here:
- #lorem(10)
#block(width: 100%, $ x $)
#lorem(10)
- #lorem(10)