Have you read the manual section on link/image attributes? You can set explicit width and height attributes on images. https://pandoc.org/MANUAL.html#extension-link_attributes However DOCX has specific problems with TIFF, perhaps also with other formats? https://github.com/jgm/pandoc/issues/7405 (Apparently this will be fixed in the next release.) Den mån 12 juli 2021 19:43Andrew Voelkel skrev: > Help! I've been messing around for hours and I still can't figure out a > viable strategy for dealing with images in pandoc documents. The "must > have" for this project is to be able to get good docx output for the > images, and be able to have control over the size of the images in the > docx. > > So far, the only satisfactory results I've gotten are from content > originating in my drawing program (Omnigraffle), and saved in PDF format, > then inserted into the docx (via markdown, of course). In this case, the > original size of the graphic is respected. However, when I try to use pngs > which I've inherited, Word seems to want to resize them to hit both left > and right margins, regardless of their original size. I haven't figured out > a way around this. This is true even if I import the png into the drawing > program and export as PDF. > > So, first question - is there a way to indicate the image size in the > markdown such that the docx output will reflect that setting? > > In addition to the "must have" of good docx output, it would be nice to > have the html output of the markdown also display the images properly when > composing the document in markdown. I've noticed that depending on the > renderer, the {width=400px} directive will sometimes be respected in the > output. But there are two problems. > > First, it doesn't seem that importing PDFs works when rendering markdown > to html. So the PDFs which are the only solution for docx don't work in > this situation. > > Second, it would seem that I'd need to have and "ifdef" type of > functionality in the markdown, so that the image sizing directive could > depend on whether I'm previewing html or telling pandoc to size the image > for Word. I don't know of any such thing. > > What are other folks doing to deal with these issues? They hardly seem > exotic. If I could get raster graphics to size properly for both html and > docx output, I could just save all my graphics as raster graphics, with a > high DPI value so that the scaling should look OK. But I can't seem to get > there from here. > > Any help or pointers to in depth information about related subjects would > be highly appreciated!! > > -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/c708a157-059e-4dc2-a562-797aa11ae620n%40googlegroups.com > > . > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhA9nGi_VYT-qbzBTbgeSifxvAy7j2h%3Dm7FFJRYbqRQv1g%40mail.gmail.com.