Open deel-sider opened 3 years ago
Hi @kpl05.
Interesting observation. Our primary target has been making sure things render correctly within Microsoft Word, as in the pharma industry, these RTF documents often get handed off to medical writers who use Microsoft Word to assemble their reports. And even though word reads and writes RTF code, it still converts it to its own flavor in the background.
It would help if you provide a screenshot of the gap you're seeing and an example file. I'm curious if the gap is something coming from the huxtable table output or something being done by pharmaRTF.
Hi Mike,
Here is the LibreOffice screenshot as requested:
Unfortunately, Github does not seem to let me attach RTF files unless there is another way to do this so I have added a PDF file to show things in more detail.
Regards,
John
Hi Mike,
Just trying a DOCX file made in LibreOffice to see if that helps in any way because that retains the gap.
Regards,
John
Thanks - one more question, can you provide the code you used? Or create a reprex? That will help us out as well.
Hi Mike,
Here is some of the code that was used:
c19v_latest %>% dplyr::ungroup() %>% dplyr::mutate(rank=as.integer(rank(-percap))) %>% dplyr::arrange(rank) %>% dplyr::select(rank,location,population,date,total_vaccinations,percap) %>% huxtable::as_hux() %>% huxtable::set_width(1.5) %>% huxtable::set_col_width(c(0.3,1.1,0.7,0.5,1.2,0.6)) %>% huxtable::set_contents(1,1,"Order") %>% huxtable::set_contents(1,2,"Country") %>% huxtable::set_contents(1,3,"Population") %>% huxtable::set_contents(1,4,"Latest Date") %>% huxtable::set_contents(1,5,"Total Number of Vaccinations") %>% huxtable::set_contents(1,6,"Vaccinations per Capita") %>% huxtable::set_number_format(everywhere,3,fmt_pretty()) %>% huxtable::set_number_format(everywhere,5,fmt_pretty()) %>% huxtable::set_number_format(everywhere,6,"%5.5f") %>% huxtable::set_font(everywhere,everywhere,"Arial") %>% huxtable::set_all_borders() %>% pharmaRTF::rtf_doc(titles=list(hf_line("Table 7: COVID-19 Vaccinations by Per Capita Rate",font="Arial") , hf_line(" ") ) ) %>% pharmaRTF::write_rtf(file=paste0("~/Documents/python_stuff/output/c19/",tprefix,"7.rtf"))
A REPREX may take longer so I hope the above helps to add clarity.
Regards,
John
Hi,
Thanks for creating this. One thing that I have noticed is that the generated RTF files look different in LibreOffice Writer compared to how they look in Microsoft Word. In LibreOffice, there is an extra gap between the column heading and the table body that is not present in Word. While it looks as if things are being rendered differently, it this something that can be addressed?
Many thanks,
John