I’m working with a DOCX file and examining the document.xml (OOXML) file to determine the left indentation of paragraphs. Specifically, I’m trying to calculate the distance from the left margin to the first pixel of a numbered paragraph.
I’ve found this to be quite tricky, especially with numbered paragraphs. In some cases, the indentation equals indent
, but this is not consistent. Sometimes it seems to be indent - hanging-indent
.
I suspect there are other factors that influence the indentation calculation, as both MS Word and LibreOffice render the indentations correctly.
Can anyone explain the algorithm or rules used to compute the left indentation for numbered paragraphs in OOXML? Any insights or references to relevant documentation would be greatly appreciated.
(the data you see on the screenshot is edn format but it is directly obtained from the ooxml via Apache POI)