-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Misplaced equation when converting from markdown to ODT #7777
Comments
the XML that is generated (in <text:p text:style-name="First_20_paragraph">Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text:</text:p>
<text:p text:style-name="Text_20_body">
<draw:frame draw:style-name="fr2" text:anchor-type="paragraph">
<draw:object xlink:href="Formula-0/" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame>
</text:p> so seems like the formula is just places as some sort of floating object? what do you think it should be? |
The ODT structure seems correct, so is it a LibreOffice bug? I also noticed that editing inside Libre Office and switching to 'as char' anchor type, moves the anchor from the end of the text to the middle of the text, which is not correct in my opinion. Changing the code so to use A non-optimal workaround is to add a line break just before the equation
knowing that the added line-break will be oddly placed after the equation. UpdateI discovered that the issue show up only if the equation is too high. In fact, it doesn't show up with |
I asked about this issue on LibreOffice forum and I got some hints which are beyond my knowledge, but hopefully clearer to some pandoc contributor: https://ask.libreoffice.org/t/misplaced-equation-possible-bug/72111?u=nopria |
I opened this in MS Word and the equation displayed after the text. |
Setting anchor-type to frame gets the vertical position right, but loses the centering. |
Setting anchor-type to "character" also fix the vertical placement. Since the standalone equation (i.e. "$$...$$") is placed in a dedicated paragraph, why not center it? Stand alone equations usually are centered, isn't it? |
I think I've fixed this -- can you test? |
Sorry, I can't test, I tried to install the master branch compiling it from source but after a couple of times kicking me out of WSL2 without errors during
Maybe that was above the capabilities of Windows Subsystem for Linux. |
Hm. Not sure, the part you quote only contains a warning, so the true error must be further up (it says it concerns commonmark-pandoc). Scroll up further to find it. |
You're right, here it is:
|
Not sure what is going on there, but I don't think it's a problem with the library itself; rather, a problem with your stack setup. You could try deleting (better, moving) your |
By the way, if you already tested the fix it's fine for me, I'll wait for next pandoc release 2.16.3. |
It should be in a nightly soon. (You could also try using cabal install.) |
Explain the problem.
If I convert to ODT the following simple markdown document
using the command
pandoc test.md -s --self-contained -o test.odt
I get the equation wrongly placed between two lines of text, while it should be after the end of text.
see https://stackoverflow.com/q/70472898/694360
Pandoc version?
I'm using
pandoc 2.16.2 Compiled with pandoc-types 1.22.1, texmath 0.12.3.2, skylighting 0.12.1, citeproc 0.6, ipynb 0.1.0.2
under Ubuntu 20.04.3 running on Windows Subsystem for Linux (WSL 2).
The text was updated successfully, but these errors were encountered: