-
-
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
emf aspect ratio unequally scaled to 1.2 w: 1 h in docx (pandoc 1.16.0.2, Mac OS X) #2720
Comments
I can't help at all without having a simple example I can
test with, using plain pandoc. Can you link to or quote
as much of Report.md as is necessary to reproduce the issue?
|
Pandoc currently can't determine the dimensions of emf / Windows Metafile images. I'm not sure whether it's unusual that RMarkdown produces an |
A minimal example is in Archiv.zip (Report.md, without size information; the EMF graphic and the rendered docx file; also a screen shot for the formatting window of the word processor is included showing the unequal scaling). I understand that EMF is not supported and have switched to postscript / EPS. Sorry for raising this; I was intrigued by the error message disappearing when updating to 1.16 and did not check for supported formats. |
pandoc 1.16 doesn't emit the |
Have documented a work around which works for me to use EMF graphics from Rmarkdown rendered into docx: https://github.com/rfhb/rmarkdownknitrpandocemf. |
When rendering a R markdown document with plots using
device='emf'
into a docx document, all plots in the docx file are scaled to 69% height and 83% width. This does not depend on any setting of figure width or height in R. The rendering results in an undesirable aspect ratio, distorting the plots. In a word processor, the scaling would need to be reset for every plot manually. This is the command line:pandoc Report.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output Report.docx
There is no relevant output using
--verbose
. Could this be a problem with the image size detection? Using pandoc 1.15, the type and size of emf files was not detected at all by pandoc (the error message waspandoc: Could not determine image size in 'RMarkdownReport_files/figure-docx/figure-1.emf': could not determine image type
.In any case it would be preferred if the docx writer would not set any image size for the emf file. Thanks.
The text was updated successfully, but these errors were encountered: