davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
245 stars 44 forks source link

Regression between 0.8.7 and 0.8.8 #219

Closed eusebe closed 6 years ago

eusebe commented 6 years ago

Hi David,

I've just noticed a little regression between ReporteRs 0.8.7 and 0.8.8. When using addParagraph with a pot object, the stylename option doesn't produce the expected result.

Here an example (the two generated word files are attached):

library(ReporteRs) ## Version 0.8.8
doc <- docx() ; styles(doc) 

doc <- addParagraph(doc, value = "TITLE" + pot("®",textProperties(vertical.align = "superscript", font.size = 28, font.family = "Arial", color = "mediumseagreen")), stylename = "TitleDoc")
writeDoc(doc, "bug_8.8.docx")

library(devtools)
install_version("ReporteRs", version = "0.8.7", repos = "http://cran.us.r-project.org")

library(ReporteRs)
doc <- docx() ; styles(doc) 

doc <- addParagraph(doc, value = "TITLE" + pot("®",textProperties(vertical.align = "superscript", font.size = 28, font.family = "Arial", color = "mediumseagreen")), stylename = "TitleDoc")
writeDoc(doc, "bug_8.7.docx")

bug_8.7.docx bug_8.8.docx

Is there any workaround? Thank you very much. David

eusebe commented 6 years ago

Hi David,

Is there something wrong with my reproducible code? The first call of ReporteRs is the version 0.8.8, the second call is 0.8.7.

Switching to officer/flextable isn't really an option her (with my current project, I use ReporteRs to generate several reports with hundred of paragraphs, figures and tables, it would be too long to recode everything). I'm planning to switch, but with my new projects.

Thank you very much. Best, David

davidgohel commented 6 years ago

Hi David,

Sorry, I don't have enough time...

I did not work on ReporteRs since a long time, but I remember about this, this is not a regression, it's a decision I made after users' complains, in the documentation, it is written This argument can only be used when value is a character vector. I am stuck here, if I change that, you will be happy but other users will be unhappy and if I don't change that, well, you will be unhappy and the other happy :/

So the rule is :

David

PS : if you need a consultant to do the migration, I am available ;)