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

Unclear if possible to add a bullet list on a doc #262

Closed
stefanoborini opened this issue Dec 4, 2019 · 11 comments
Closed

Unclear if possible to add a bullet list on a doc #262

stefanoborini opened this issue Dec 4, 2019 · 11 comments

Comments

@stefanoborini
Copy link

It is unclear, and it seems that it's not possible at the moment, to add a bullet list to a doc file. If it's possible, the documentation does not report how. A google search came up inconclusive.

Is the feature supported? If not, this issue acts as a feature request.

@davidgohel
Copy link
Owner

This can be done by adding paragraphs with a style that has bullets.

template.docx

library(magrittr)

doc <- read_docx(path = "template.docx") %>%
  body_add_par("item 1", style = "bullet") %>%
  body_add_par("item 2", style = "bullet") %>%
  body_add_par("item 3", style = "bullet")

print(doc, target = "test.docx" )

Capture d’écran 2019-12-04 à 16 03 09

@stefanoborini
Copy link
Author

stefanoborini commented Dec 4, 2019

Uhh, thanks! But I recommend to add it more explicitly to the documentation, as I could not find it.

@davidgohel
Copy link
Owner

thanks for the recommandation

@stefanoborini
Copy link
Author

For the record, this is apparently not working in 0.3.2

Warning: Error in : could not match any style named 'bullet' in c('Normal', 'heading 1', 'heading 2', 'heading 3', 'centered', 'graphic title', 'table title', 'toc 1', 'toc 2', 'Balloon Text')

@davidgohel
Copy link
Owner

What code did you used?

In general, it helps to provide the elements described in the guidelines displayed when you open an issue (sessionInfo(), a reproducible example).

@davidgohel
Copy link
Owner

(I think you did not use the template attached in my answer)

@stefanoborini
Copy link
Author

stefanoborini commented Dec 4, 2019

R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3
self$.doc <- officer::read_docx()            
p <- officer::body_add_par                                                        
p(self$.doc, "Input files provided", style = "heading 2")                         
p(self$.doc, "The following files were used to define the calculation:")          
p(self$.doc, paste("File: ", file$filename), style="bullet") 

@davidgohel
Copy link
Owner

so you did not used the template I attached

@stefanoborini
Copy link
Author

Sorry I missed that.

@stefanoborini
Copy link
Author

Excellent! thanks. sorry, too much to handle at the same time.

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants