You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
List indentation should not depend on marker width #4126
Because the layout of lists (list and enum) 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
+ one
+ two
+ three
intervening paragraph
11. eleven
+ twelve
+ thirteen
In contrast, LaTeX, Google Docs, and Microsoft Word all seem to let users set the indentation based on the list item bodies.
When list marker is left aligned, the dot will not be aligned:
\usepackage{enumitem}
\newcommand\setItemnumber[1]{\setcounter{enumi}{\numexpr#1-1\relax}}
\begin{enumerate}[align=left]
\item first
\item second
\setItemnumber{500000000000}
\item very large
\end{enumerate}
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.
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.
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.
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 😎
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.
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.
Comparison between LaTeX and word for lists with longer content. @laurmaedje what do you think of this? Will it make sense if we switch enum/list implementation to something similar to this?
Yes, I think we should switch lists to something like this. I believe Word uses tab stops to implement the behaviour. Without them or a min-width property, I think it will be hard to get this behaviour. I started a branch for tab stops recently.
Sounds cool! I'd like to do some initial work by reimplementing list/enum in a term-list-like way. And I guess I can somehow use your tab stop feature when it is merged.
changed the title [-]Inconsistent list indentation depending on marker width[/-][+]List indentation should not depend on marker width[/+]on Oct 8, 2024
Activity
[-]Write a short and descriptive title![/-][+]Inconsistent list indentation depending on marker width[/+]Enter-tainer commentedon Jun 4, 2024
In LaTeX, the list markers are right aligned, and there is a minimal gap between list marker and actual content.
Enter-tainer commentedon Jun 5, 2024
When list marker is left aligned, the dot will not be aligned:
Enter-tainer commentedon Jun 5, 2024
Looks like word and latex has interesting behavior when aligning list markers and list content
Microsoft word:
LaTeX:
Enter-tainer commentedon Jun 5, 2024
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.
Enivex commentedon Jun 5, 2024
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.
Enter-tainer commentedon Jun 5, 2024
Yes, that is correct.
Enter-tainer commentedon Jun 5, 2024
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 😎
Enivex commentedon Jun 5, 2024
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.
Enter-tainer commentedon Jun 5, 2024
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.
Enter-tainer commentedon Jul 7, 2024
Comparison between LaTeX and word for lists with longer content. @laurmaedje what do you think of this? Will it make sense if we switch enum/list implementation to something similar to this?
laurmaedje commentedon Jul 8, 2024
Yes, I think we should switch lists to something like this. I believe Word uses tab stops to implement the behaviour. Without them or a min-width property, I think it will be hard to get this behaviour. I started a branch for tab stops recently.
Enter-tainer commentedon Jul 8, 2024
Sounds cool! I'd like to do some initial work by reimplementing list/enum in a term-list-like way. And I guess I can somehow use your tab stop feature when it is merged.
[-]Inconsistent list indentation depending on marker width[/-][+]List indentation should not depend on marker width[/+]