-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support customisable indentation of nested lists in .docx output #6586
Comments
Agree this would be nice. I also have the vague feeling this has already been discussed in some issue and was somehow trickier to implement than expected... |
Well, as a practical user of Pandoc, I will be satisfied with any solution that will let me customize the indentation of enumerated lists—first make it work, then make it pretty. For a start, it seems possible to copy the indent and hanging indent from the List style of the corresponding level, in order not to hardcode them at least. On the other hand, since the indentation of nested lists has very little reason to be irregular and the label of the next level should be indented as the body of the previous one, a single indentation step setting will do as well. |
If the modification is too difficult, will you please change the hard-coded indentation settings so that nested list levels match, i.e. set the left indent fror nested list levels to multiples of 0.85 cm: 0.00, 0.85, 1.70, ... because they already have a hard-coded hanging indent of 0.85 cm. |
Maybe this is indeed possible to implement, we'll have to check... meanwhile, there are a few related tickets around: https://github.com/jgm/pandoc/issues?q=is%3Aopen+is%3Aissue+label%3Aformat%3ADocx+label%3Awriter+list |
Lots of stuff there, mb21. Do you think I could fix the indentation using a Lua filter? Should I have to hard-code the fixed indentations into the filter, or can it be passed down to the filter from the command line? |
I had the very same issue. I was able to work around the problem by manually editing |
Hmm. Just now I realized there is a problem with my solution. After I add lists to the reference, the generated lists go crazy. In particular, I have bullet lists instead of number lists and vice versa! Also, the starting numbers of the number lists are also messed up. I tried adjusting |
After thinking about it some more, I am fully convinced that the only simple and effective solution would be to modify Pandoc so that it
I should be simple enough and will make Pandoc better by removing a couple of hard-coded constants. |
@ant-222 feel free to make a pull request! |
mb21:
Do you think I can manage it without any knowledge of Haskell, on a Windows XP machine with MinGW? As far as I remeber, the latest Pandoc binary fow Winodws does not work on XP... |
I believe what @mb21 thought that, after reading that the change "should be simple enough", that there would be a solution ready at hand. Don't worry though, you can help even without a working Haskell installation. Describing the necessary changes to the XML output would already be an important contribution. Can you help us out with that? |
Last year I investigated something related in #4321. I identified potential places to at least manage step and indentation via styles. |
tarleb, Yes, I think I can specify the desired results in terms of XML output inside the |
Pandoc does not seem to respect any styles or settings in the reference document while choosing the horizontal indentation of numbered lists. In fact, a handing indent 0.85 cm seems to be hard-coded for the list item and a mismatching indent of 1.27 cm for nested lists, which produces nested lists with the labels of the next level indented father than the body of the previous level.
Numbered lists being a basic typesetting element without which professional documentation is hardly possible, I propose to modify Pandoc so that it shall borrow both indentation parameters for each list level from a corresponding style in the reference document. The ability to customise the indentation of lists is crucial because no hard-coded constant can producer well-looking results with all paper- and font sizes.
I have tested this with Pandoc 2.10.1, using the following example:
The text was updated successfully, but these errors were encountered: