tomduck / pandoc-tablenos

A pandoc filter for numbering tables and table references.
GNU General Public License v3.0
108 stars 8 forks source link

docx output: extra blank line before table #6

Closed kugelblitz closed 6 years ago

kugelblitz commented 7 years ago

Hello,

The docx output basically works, though the three docx output files for examples stored in the repo give a false impression that it does not.

That said, I have a serious problem using pandoc-tablenos with docx output: the filter adds an extra blank line before each table's caption. There is no extra blank line if I skip applying the filter. I do not understand the cause and found no way to work that around, can you help me?

Best regards,

Dmitry

jrennstich commented 7 years ago

I have the same issue.

tomduck commented 6 years ago

I'm restarting work on docx support for the pandoc-fignos/eqnos/tablenos filters. I'm hoping to do either pandoc-fignos or pandoc-eqnos first. See:

and corresponding wikis to organize materials at:

Once those two have been solved, moving on to solve the same problem in pandoc-tablenos should be pretty straight-forward.

landlord11 commented 6 years ago

Hi, I ran into this problem with pandoc-fignos, and making this change to the code removed the blank line:

@@ -258,10 +258,10 @@
             # As per http://officeopenxml.com/WPhyperlink.php
             bookmarkstart = \
               RawBlock('openxml',
-                       '<w:p><w:bookmarkStart w:id="0" w:name="%s"/><w:r><w:t>'
+                       '<w:bookmarkStart w:id="0" w:name="%s"/>'
                        %attrs[0])
             bookmarkend = \
-              RawBlock('openxml', '</w:t></w:r><w:bookmarkEnd w:id="0"/></w:p>')
+              RawBlock('openxml', '<w:bookmarkEnd w:id="0"/>')
             return [bookmarkstart, Para(value), bookmarkend]

I assume something similar is being done in tablenos, too. Hope this helps.

Brian

tomduck commented 6 years ago

Thank you all for this bug report, and @landlord11 for the working code. I have implemented it as above in the nextrelease branch of both pandoc-fignos and pandoc-tablenos, and will ship new versions to pipy in the next few days. Please let me know if anything breaks: I am not a docx user.

Cheers, Tom

tomduck commented 6 years ago

I'm closing this in anticipation of a new release today.