Skip to content

Docx Writer default list style indents fail for long lists #10821

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

Open
jblachly opened this issue May 6, 2025 · 2 comments
Open

Docx Writer default list style indents fail for long lists #10821

jblachly opened this issue May 6, 2025 · 2 comments
Labels

Comments

@jblachly
Copy link

jblachly commented May 6, 2025

Problem Statement
When creating docx files with a list longer than 99 items, the indent and hanging indent settings cause a visually-undesirable behavior (bug)

Reproduction

echo "<html><body><ol>" > /tmp/list.html && for i in {1..150}; do echo "<li>Number ${i}</li>" >> /tmp/list.html; done && echo "</ol></body></html>" >> /tmp/list.html
pandoc -f html -t docx -o /tmp/list.docx /tmp/list.html

Demo

Image

Alternative Better Indents:

Image

Root Cause

step = 720
hang :: Int
hang = 360

(I think )

Pandoc version?

pandoc 3.5
Features: +server +lua
Scripting engine: Lua 5.4

Related Issues

@jblachly jblachly added the bug label May 6, 2025
@jblachly
Copy link
Author

jblachly commented May 6, 2025

As related issues indicate, as well as past discussion (https://inbox.vuxu.org/pandoc-discuss/[email protected]/), it would be a heavy lift to rewrite the List code to use list styles.

Are you open to simply changing the hardcoded values given that the defaults produce ugly docx?

@jgm
Copy link
Owner

jgm commented May 6, 2025

I'm open to it -- as long as the new default is not ugly for the much more common case of one or two-digit list markers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants