-
-
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
docx writer - "different odd/even pages" is not selected even if template has it on #3901
Comments
Could you post a link to the reference docx that has this feature? |
Certainly. I created a mimimum (non)working example showing this problem, with a simple markdown file with steps to reproduce, the reference docx, and the resulting docx I get with pandoc. Even though I said inside it was with version 1.18, actually for today's example I installed v1.19.2.1 (same problem) |
At first glance it seems simply writing I've never coded in haskell, but reading the source comments, maybe adding |
Can you modify the generated docx file and test this? The docx is just a zip which you can modify with the usual tools... |
Yes I tested it manually before posting, that's why I proposed including it in the docx. I should have mentioned it earlier, sorry. I wasn't sure if on the pandoc side there was something else to consider. |
This seems like a simple enough fix to try. |
@agusmba Pull requests are always welcome and hacking on pandoc is a great way to get your feet wet with real-world haskell! Personally, I recommend using stack to build the pandoc source code:
see also http://learnyouahaskell.com/chapters and maybe https://github.com/jgm/pandoc/blob/master/CONTRIBUTING.md |
Ok, I got a working pandoc in my PC with this issue fixed. |
We don't really have any tests for the docx writer at the
moment! (I know, it's shameful.) So don't feel like you
need to add those for the PR.
+++ Agustín Martín Barbero [Oct 09 17 22:13 ]:
… Ok, I got a working pandoc in my PC with this issue fixed.
I'll check if the current tests are still OK, and I should try to write
an automatic test for this issue (this will probably take a lot longer
than the fix itself...)
—
You are receiving this because you commented.
Reply to this email directly, [1]view it on GitHub, or [2]mute the
thread.
References
1. #3901 (comment)
2. https://github.com/notifications/unsubscribe-auth/AAAL5DqYL0X712LPdc5_dA4yvR_4ON5Eks5sqpqPgaJpZM4PQ3ih
|
Mmmm I don't see an easy way of automating tests for this. I have checked that all current tests run OK, and I have manually tested that the fix works for reference doc with and without the evenAndOddHeaders mark set. It seems all tests (at least in the docx writer section) deal with native pandoc representation of the document. However this is not the case here, as the presence (or absence) of the evenAndOddHeaders mark is only dealt with at the docx writing stage, and as far as I can see is not reflected in the internal pandoc format. How would you go about making an automated test for this case? EDIT: @jgm I just saw your comment, I'll make the PR then with the simple fix. |
Fixes jgm#3901 by checking for the evenAndOddHeaders mark in the reference doc, and copying it to the resulting docx if present.
+++ Agustín Martín Barbero [Oct 09 17 15:56 ]:
It seems all tests (at least in the docx writer section) deal with
native pandoc representation of the document. However this is not the
case here, as the presence (or absence) of the evenAndOddHeaders mark
is only dealt with at the docx writing stage, and as far as I can see
is not reflected in the internal pandoc format.
Yes, the current tests are just round-trip tests to see that
write docx >=> read docx is the identity in various cases.
That won't help with these presentational details.
How would you go about making an automated test for this case?
You'd have to write a custom test that uses writeDocx to
create a docx using a special refererence.docx, then uses
zip-archive to unzip it and check that it contains the
evenAndOddHeaders mark. But I think it's okay to go without
this.
|
First of all thank you for making this amazing tool.
I'm trying to set up a markdown -> docx pipeline, using pandoc 1.18 on windows 7.
I'm tweaking the docx template (reference-docx), but I just realized that odd/even pages selection (header/footer) on my template is not honored in the generated docx (thus the odd style is applied to the whole document).
WORKAROUND:
Thankfully the even/odd styles are not lost and I can manually go to the header of the generated docx and select "different odd/even pages" and I will get the expected result.
Ideally the generated docx should have this option selected if the reference-docx had it.
The text was updated successfully, but these errors were encountered: