typst
typst copied to clipboard
Paragraph should be able to contain tight lists and block-level equations
Currently, a tight list attaches to the preceding paragraph when there is no whitespace, and a new paragraph is always created after the list.
In this case, this behavior is not desirable, because everything here is really part of the same paragraph.
For comparison, the behavior in LaTeX is that the next line is also part of the paragraph (new paragraphs are indented by default)
unless whitespace is added
This is related to how typst handles paragraphs. A list is a different element than a paragraph, so, no matter how many lines are placed between the list and the next piece of content, it will treat the next piece of content as its own paragraph.
A paragraph is only indented if it follows another paragraph (and has first-line-indent != 0 and some alignment stuff). Typst doesn't consider a list a paragraph. Hence, the content that comes after the list will be its own paragraph, and that paragraph will not be indented.
I've forked the repo, because I think the paragraph element is too limited as it is. I'm attempting to change that.
I modified the title to reflect that this is a wider issue
Another example: Figures that are not top or bottom
I'm not really convinced that a figure really makes sense as part of a paragraph.
I'm not really convinced that a figure really makes sense as part of a paragraph.
How sensical you or anyone else thinks it is doesn't matter. This is a typesetting software. Disallowing some sort of formatting because it doesn't make sense to someone would be limiting.
A figure is a block of content. A paragraph is a string of connected ideas. If one of those ideas is best given as an equation block, code block, figure block, etc., then discriminating between content blocks is limiting to the string of connected ideas used to form the paragraph.
We don't disallow putting arbitrary stuff in paragraphs, that's what the box function is for. (For what it's worth, HTML does disallow block-level elements in paragraphs.) The question here is how various elements interact when not explicitly boxed --- that's a question of language design and thus it definitely matters what me or anyone else thinks (you obviously believe that it matters what you think after all). If you want to be constructive, you are invited to make your point. But please stay friendly.
I'm sorry if I seemed rude in my previous comment. I in no way meant it antagonistically. My apologies!