davidgohel / officedown

https://ardata-fr.github.io/officeverse/officedown-for-word.html
Other
366 stars 27 forks source link

Issue with out.width not affecting image size in officedown::rdocx_document #144

Closed lizhiwei1994 closed 6 days ago

lizhiwei1994 commented 2 months ago

I am trying to generate a Word document with R using the officedown::rdocx_document output format. When I use the standard output: word_document option, I can easily control the size of images in the output by setting different values for the out.width parameter in my RMarkdown document. However, when I switch to officedown::rdocx_document, the images are not resizing as expected. No matter what value I set for out.width, the image size remains unchanged.

Here's a minimal reproducible example:

Using output: word_document option:

---
output: word_document
---

```{r setup, include=FALSE}
library(officedown)
library(officer)

out.width='10%'

boxplot(1:8)

out.width='90%'

boxplot(1:8)

**Using `officedown::rdocx_document` option**:

output: officedown::rdocx_document

library(officedown)
library(officer)

out.width='10%'

boxplot(1:8)

out.width='90%'

boxplot(1:8)
davidgohel commented 2 months ago

I read:

I did not work on it yet, you don't need to open duplicates every day until I find a fix

lizhiwei1994 commented 2 months ago

Thank you for your response and for looking into this issue. I apologize for any inconvenience caused by the duplicate posts. I appreciate your efforts in addressing this problem, and I'll wait for your update whenever you have a chance to work on it.

Thanks again for your time and help!

Best regards,

zhiwei

davidgohel commented 6 days ago

it should be OK now