-
-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent list indentation depending on marker width #4126
Comments
Looks like word and latex has interesting behavior when aligning list markers and list content LaTeX:
|
Overall I feel like both word, typst and LaTeX's solution is good. Currently typst can align list content and list marker using grids, at the cost of baseline mismatch. It would be better if list marker in typst can be in the paragraph as list content, so they share the same baseline naturally. For me i think normal people will never notice the alignment difference: they will never have a super long list that has more than 100 items. |
The list doesn't necessarily have to include more than 100 items. You can skip numbers. You may also use non-decimal numbers (roman numerals for instance) Real life example: Doing a review where the numbers correspond to page or line numbers. |
Yes, that is correct. |
For this case, I think we can first measure the maximum width of all list markers. Then we can correctly set the width of the box. So we can beat LaTeX and word 😎 |
I think that tex and word is choosing a middle ground on purpose. Imagine you had one label that's much longer than the other ones. |
It looks like the default in tex and word can fit in 3~4 numbers. I think this is a good default and this covers most use case. The width can also be customized. |
Description
Because the layout of lists (
list
andenum
) are adjusted by the spacing before and after markers, the width of the marker itself can affect the indentation of the list. Since different lists' markers can have different widths, this means that lists can have different indentation:Screenshot
Typst code to reproduce
In contrast, LaTeX, Google Docs, and Microsoft Word all seem to let users set the indentation based on the list item bodies.
LaTeX
Google Docs
Microsoft Word
Reproduction URL
https://typst.app/project/rqnPOljOs8eDzgh36DKpki
Operating system
Web app, macOS
Typst version
The text was updated successfully, but these errors were encountered: