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

bug: orgdocx writer loses whitespace when separated by #+latex keyword #7724

Closed
pank opened this issue Nov 30, 2021 · 1 comment · Fixed by #7844
Closed

bug: orgdocx writer loses whitespace when separated by #+latex keyword #7724

pank opened this issue Nov 30, 2021 · 1 comment · Fixed by #7844

Comments

@pank
Copy link

pank commented Nov 30, 2021

Hi,

Explain the problem.
Exporting from org, the docx writer seems to eat up too much white space between tables if there's a #+latex: line in between. It does not seem to happen with e.g. html.

Example:

$ cat test0.org 
* test0
| a | b |

| c | d |

$ cat test1.org 
* test1
| a | b |

#+latex:

| c | d |

$ pandoc test*.org -f org -t docx -o test.docx

The output is basically

test0

a b
c d

test1

a b
c d

But there shouldn't have been a difference between the two sections; both sections should have been like test0. See screenshot at end.

HTML and LaTeX exports work as expected (e.g. pandoc test*.org -f org -t {html,latex} --standalone).

Pandoc version?
pandoc v2.14.1 on GNU/Linux and Windows.

image

Thanks,
Rasmus

@pank pank added the bug label Nov 30, 2021
@pank pank changed the title bug: org -> docx writer loses whitespace when separated by #+latex keyword bug: org → docx writer loses whitespace when separated by #+latex keyword Nov 30, 2021
@pank pank changed the title bug: org → docx writer loses whitespace when separated by #+latex keyword bug: orgdocx writer loses whitespace when separated by #+latex keyword Nov 30, 2021
brisad added a commit to brisad/pandoc that referenced this issue Jan 17, 2022
Adjacent docx tables need to be separated by an empty paragraph. If
there's a RawBlock between tables which renders to nothing, be sure to
still insert the empty paragraph so that they will not collapse
together.

Fixes jgm#7724
@brisad
Copy link
Contributor

brisad commented Jan 17, 2022

Adjacent tables need to be separated by an empty paragraph, which is done here:

-- Word combines adjacent tables unless you put an empty paragraph between
-- them. See #4315.
separateTables :: [Block] -> [Block]
separateTables [] = []
separateTables (x@Table{}:xs@(Table{}:_)) =
x : RawBlock (Format "openxml") "<w:p />" : separateTables xs
separateTables (x:xs) = x : separateTables xs

The presence of a RawBlock that renders to nothing prevents the insertion of the paragraph.

@jgm jgm closed this as completed in #7844 Jan 18, 2022
jgm pushed a commit that referenced this issue Jan 18, 2022
Adjacent docx tables need to be separated by an empty paragraph. If
there's a RawBlock between tables which renders to nothing, be sure to
still insert the empty paragraph so that they will not collapse
together.

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

Successfully merging a pull request may close this issue.

3 participants