Skip to content
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

Pandoc 2.4 regression: (@) and odt #5076

Open
AugustH opened this issue Nov 14, 2018 · 23 comments
Open

Pandoc 2.4 regression: (@) and odt #5076

AugustH opened this issue Nov 14, 2018 · 23 comments

Comments

@AugustH
Copy link

AugustH commented Nov 14, 2018

Sample:

text

(@) text

    text

text

compile with:
pandoc -f markdown test.md -o test.odt

output changed with pandoc 2.4 (on linux mint, libreoffice 6.0.6): the numbered paragraph is indented

@mb21
Copy link
Collaborator

mb21 commented Nov 14, 2018

Output changed from what version? Isn't the new output better?

Maybe this was this change back in 2017: 34b9bee#diff-75ef96f1820e7e194afee0dd28277dd6 ?

@AugustH
Copy link
Author

AugustH commented Nov 14, 2018

sorry, change was from 2.3 to 2.4 -- and the output looks different from latex/pdf and docx. And it doesn't look good either :-(

Example from one of my documents:

bad
vs.

godd

@jgm
Copy link
Owner

jgm commented Nov 14, 2018

This probably has to do with the following changelog entry:

  * Text.Pandoc.Writers.OpenDocument: Improve bullet/numbering
    alignment (#4385). This change eliminates the large gap we used
    to have between bullet and text, and also ensures that numbers
    in numbered lists will be right-aligned.

See #4385 and commit f82d574.
Needs more fine tuning, it appears.

@jgm
Copy link
Owner

jgm commented Nov 14, 2018

% diff test2221/content.xml test24/content.xml 
9c9,11
<         <style:list-level-properties text:space-before="0.0in" text:min-label-width="0.4in" />
---
>         <style:list-level-properties text:list-level-position-and-space-mode="label-alignment" fo:text-align="right">
>           <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.1in" fo:margin-left="0.5in" />
>         </style:list-level-properties>

where 2221 is pandoc 2.2.2.1, 24 is pandoc 2.4.

@jgm
Copy link
Owner

jgm commented Nov 23, 2018

Fixed by #5095, I believe.

@jgm jgm closed this as completed Nov 23, 2018
@AugustH
Copy link
Author

AugustH commented Nov 27, 2018

just checked with 2.5: as bad as 2.4 -- should the fix the commit be in pandoc 2.5 ?

@jgm
Copy link
Owner

jgm commented Nov 28, 2018

Yes. The fix is in. Here's what I see in LibreOffice:
screen shot 2018-11-27 at 4 06 02 pm

The numbered list is indented, yes. But just like in LibreOffice's defaults: marker to 0.25 in, Body to 0.5in.

The other alignment issues (demonstrated in the screenshot you uploaded above) are fixed, or should be. If not, give more details.

@AugustH
Copy link
Author

AugustH commented Nov 28, 2018

But the indentation is a change -- there was no indentation up to 2.3. And neither the pdf/latex output nor docx output has this indentation. And just for the records: the (@) is a "numbered example lists", not a normal numbered list.

Ok i could live with the change if there a way to change this via a reference.odt file. Is there such a way?

@jgm
Copy link
Owner

jgm commented Nov 29, 2018 via email

@pyssling
Copy link
Contributor

@AugustH could you be more clear on which of your examples corresponds to which version?

My personal view is that ODT should look like a libreoffice document.

Could we clarify what exactly the remaining issues are? Is it only that the first list level is indented?

This is, I'm quite sure, not configurable via a template or reference. Ideally we would eventually add support for CSS on the ODT writer. The XML tags are very similar to HTML in their semantics, so this should be doable.

@jgm
Copy link
Owner

jgm commented Nov 29, 2018 via email

@AugustH
Copy link
Author

AugustH commented Nov 29, 2018

Some screenshots
Odt pandoc 2.3 number is left
screenshot_p23
Odt pandoc 2.4 -- oops
screenshot_p24
Odt pandoc 2.5 -- number moved to the right side, much more indentation
screenshot_p25
as a reference latex (unchanged between versions)
screenshot_latex-p25

@pyssling
Copy link
Contributor

@AugustH I see the conundrum. I think the answer to this is that the ODT writer is naive. The (1) is a wide enumerator, so the space before the first text ends up being quite small. Furthermore, the font sizes are not comparable, I think this exaggerates the effect a bit.

I think the 2.5 behavior is preferable to both the 2.3 and 2.4 behavior, it is the closest to the latex behavior. We could do some micro adjustments, but I think that they would make other use-cases uglier. The ODT writer is simply not dynamic in the same way as the latex layout engine.

@jgm
Copy link
Owner

jgm commented Nov 29, 2018 via email

@AugustH
Copy link
Author

AugustH commented Jan 6, 2019

another problem with the version 2.5 odt-output: it breaks for "bigger" numbers (10).
screenshot_20190106_235038

could someone reopen this issue?

@jgm jgm reopened this Jan 6, 2019
@jgm
Copy link
Owner

jgm commented Jan 6, 2019

We can increase the width, as noted above, but this will make bullets look worse.

@pyssling
Copy link
Contributor

pyssling commented Jan 7, 2019

I would like to see what libreoffice does. I have tried to replicate that behaviour, but if this is what it does then that's not good enough.

I'll try to create a libreoffice document today.

@pyssling
Copy link
Contributor

pyssling commented Jan 8, 2019

@AugustH I replicated this behaviour in Libreoffice, it behaves the exact same way. I can file a bug on libreoffice and see what they say, my guess is that (10) overflows some buffer where the next tab stop becomes the correct one.

@AugustH
Copy link
Author

AugustH commented Jan 8, 2019

maybe this is a problem in Libreoffice. But with pandoc 2.3 the same input created a odt-file which looked much better (screenshot from Libreoffice): much more to the left (the gray line is the left margin), enough space for the bigger numbers

Output with pandoc 2.3

@pyssling
Copy link
Contributor

pyssling commented Jan 8, 2019

Yes, I see what you mean. I'm wondering what the correct behaviour should be. I agree this looks good for numbered paragraphs like this, but for a more traditional list of one line or two in point form this would look odd. This may simply be a different use-case than the traditional list.

@mb21
Copy link
Collaborator

mb21 commented Jan 9, 2019

I suppose we could make the indent dependent on whether the list marker is >9 (for ordered lists). Not sure how easy that is to implement...

@jgm
Copy link
Owner

jgm commented Jan 9, 2019 via email

@AugustH
Copy link
Author

AugustH commented Apr 24, 2019

I fixed it for me by replacing the fo:text-indent="-0.25in" to fo:text-indent="-0.5in" in the resulting odt file (content.xml).

Idea: i looked at the code: the offset is set in OpenDocument.hs in listLevelStyle. Is it possible to add an if here or actually in the calling orderedListLevelStyle: if the style d is TwoParens, the format is 1 and the level (length ls) is 1: then the indent should be changed -- actually changing it on the first two conditions would fix it for larger numbers.

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

No branches or pull requests

4 participants