Skip to content
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

How to add formatted paragraphs to a bullet list in docx #314

Open
Joaogvcostaneto opened this issue Aug 5, 2020 · 1 comment
Open

How to add formatted paragraphs to a bullet list in docx #314

Joaogvcostaneto opened this issue Aug 5, 2020 · 1 comment
Projects

Comments

@Joaogvcostaneto
Copy link

Joaogvcostaneto commented Aug 5, 2020

Hi David,

I was trying to print a bullet list with formatted paragraphs in a docx file but it seems I can't get both at the same time (bullet list and formatted), is there any way of getting it that I'm not considering? I have been reading the documentation an trying different solutions but nothing satisfactory so far... Here's an example of the code that I tried:

library(magrittr)

text_format_red <- fp_text(color = "red")
text_format_green <- fp_text(color = "green")
text_format_blue <- fp_text(color = "blue")
my_text_red <- fpar("item 1 in red", fp_t = text_format_red)
my_text_green <- fpar("item 2 in green", fp_t = text_format_green)
my_text_blue <- fpar("item 3 in blue", fp_t = text_format_blue)

doc <- read_docx("template.docx") %>%
  body_add_fpar(my_text_red, style = "BulletList") %>% 
  body_add_fpar(my_text_green, style = "BulletList") %>% 
  body_add_fpar(my_text_blue, style = "BulletList") 

print(doc, "report_test4.docx")  

also attach a picture of the output of it
bulletList

Thanks in advance,

Best regards,
João

@davidgohel
Copy link
Owner

Thanks

Yes, it's a missing feature for Word. It's a difficult part and it may take time before being implemented.

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

No branches or pull requests

2 participants