Closed drcarrot closed 7 years ago
Hi,
Thanks. If possible, use package officer
instead.
I tried to reproduce but could not.
require (ReporteRs)
doc=docx(template="report_template_empty.docx")
#Page 1
title_pot=pot("coco", textProperties(color = "white", font.family = "Georgia", font.size = 20 ))
date_pot=pot("icic", textProperties(color = "white", font.family = "Georgia", font.size = 16 ))
doc=addParagraph(doc,title_pot, bookmark="Title", par.properties= parProperties(text.align = "center"))
doc=addParagraph(doc,date_pot, bookmark="Date", par.properties= parProperties(text.align = "center"))
list_bookmarks(doc)
# [1] "Title" "Date"
# If I then modify the script downstream (i.e., change the size
# of a plot on another page) and rerun the code
doc=addPlot(doc,fun = function() barplot( 1:6, col = 2:7))
list_bookmarks(doc)
# [1] "Title" "Date"
Thank you! Perhaps it is related to the fact that I am using Rstudio? I will try using officer instead!
Steph
On Thu, Aug 31, 2017 at 10:28 AM, David Gohel notifications@github.com wrote:
Hi,
Thanks. If possible, use package officer instead.
I tried to reproduce but could not.
require (ReporteRs)
doc=docx(template="report_template_empty.docx")
Page 1
title_pot=pot("coco", textProperties(color = "white", font.family = "Georgia", font.size = 20 )) date_pot=pot("icic", textProperties(color = "white", font.family = "Georgia", font.size = 16 )) doc=addParagraph(doc,title_pot, bookmark="Title", par.properties= parProperties(text.align = "center")) doc=addParagraph(doc,date_pot, bookmark="Date", par.properties= parProperties(text.align = "center"))
list_bookmarks(doc)
[1] "Title" "Date"
If I then modify the script downstream (i.e., change the size
of a plot on another page) and rerun the code
doc=addPlot(doc,fun = function() barplot( 1:6, col = 2:7))
list_bookmarks(doc)
[1] "Title" "Date"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidgohel/ReporteRs/issues/216#issuecomment-326227222, or mute the thread https://github.com/notifications/unsubscribe-auth/AZracUiRqk9lZ6vhowImvqmINN4jOjuaks5sdm6agaJpZM4PIeDO .
No, I don't think it has anything to do with RStudio.
If possible, can you correct the script so that I am sure to be able to reproduce your case?
Thanks David
Hello,
Firstly thank you for building ReporteRs, it is a great package! I am currently using ReporteRs to create a report for my institute, and the ability to use bookmarks is very important. I am running the scripts on a server, using a template with two bookmarks on the first page. When I restart my computer (but not necessarily the Rstudio session), the bookmarks are recognized, and the report's title and date appear. If I then modify the script downstream (i.e., change the size of a plot on another page) and rerun the code, the bookmarks are not recognized. If I restart the computer (but again, stay in the same Rstudio session), the bookmarks are recognized again.
The template (attached) has two bookmarks on the title page, and the scripts are as follows:
SESSION INFO report_template_empty.docx