8000 markdown to docx -- some figures do not appear when reference docx contains an image in header · Issue #7503 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

markdown to docx -- some figures do not appear when reference docx contains an image in header #7503

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

Closed
hallieswan opened this issue Aug 16, 2021 · 11 comments
Labels

Comments

@hallieswan
Copy link

Problem

When converting markdown to docx, some figures do not appear in the docx when the reference docx contains an image in the header. If an image is not included in the reference docx header, all figures appear in the final docx.

How I can include an image in the header of the reference docx and include all plots in the final Word docx? Also posted on stackoverflow.

Exact command line used

pandoc \
minimal_example.md \
--to docx \
--from markdown \
--output minimal_example.docx \
--reference-doc custom-reference.docx

Exact input used

  1. minimal_example.md
![](minimal_example_files/figure-docx/plots-1.png)
![](minimal_example_files/figure-docx/plots-2.png)
![](minimal_example_files/figure-docx/plots-3.png)
![](minimal_example_files/figure-docx/plots-4.png)
![](minimal_example_files/figure-docx/plots-5.png)
  1. custom-reference.docx
    1. get a copy of the default reference.docx, as described in the User's Guide:
      pandoc -o custom-reference.docx --print-default-data-file reference.docx
      
    2. add an image in the header, such as the GitHub logo
  2. plots
    plots-1 plots-2 plots-3 plots-4 plots-5

Output received

The final docx includes 4 figures, instead of 5 figures.

image

Output expected

The final docx should include all 5 figures and the image in the header.

image

Pandoc version?

  • Pandoc version 2.14.1
  • macOS Big Sur 11.4
  • Microsoft Word for Mac 16.52
@hallieswan hallieswan added the bug label Aug 16, 2021
@jgm
Copy link
Owner
jgm commented Aug 17, 2021

Can you upload the reference.docx you're using?

@hallieswan
Copy link
Author

Happy to -- I've attached it here. Let me know if you need anything else!
custom-reference.docx

@jgm
Copy link
Owner
jgm commented Aug 17, 2021

Odd, I'm not able to reproduce this in my own testing.
Perhaps you could upload or link to a zip file with everything needed to reproduce the issue?

@hallieswan
Copy link
Author

Strange! Okay, I've attached a zip file. Let me know if there are any other files you'd like me to include.
minimal_example.zip

@jgm
Copy link
Owner
jgm commented Aug 17, 2021

Tested with your case and got five images in the figure...
Are you sure you're running the latest pandoc and not an older version?

@hallieswan
Copy link
Author

Just double checked my version -- I believe it's the latest. Sounds like it might be an issue on my end, I'll keep looking into it. Thanks for testing it out on your end!
image

@hallieswan
Copy link
Author

My coworker was able to reproduce the issue (macOS 11.5.1, Microsoft Word for Mac 16.52). Do you mind sharing what version of Word you're using? I'm wondering if that could be part of our problem

@jgm
Copy link
Owner
jgm commented Aug 18, 2021

Word for Mac 16.3.3
macOS 11.4

@jgm
Copy link
Owner
jgm commented Aug 18, 2021

Screen Shot 2021-08-18 at 10 14 03 AM

@jgm
Copy link
Owner
jgm commented Aug 18, 2021

Upgraded to 16.33. Still 5 images.

@hallieswan
Copy link
Author

Looks like it's a probably an issue with our Word configuration. Thank you for all of your help and time!

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

No branches or pull requests

2 participants
0