Merck / r2rtf

Easily Create Production-Ready Rich Text Format (RTF) Table and Figure
https://merck.github.io/r2rtf
GNU General Public License v3.0
76 stars 19 forks source link

Replace Unicode / LaTeX conversion table with R script #218

Closed nanxstats closed 1 month ago

nanxstats commented 3 months ago

Suggestion from @yihui: https://github.com/Merck/r2rtf/pull/217/files?diff=unified&w=0#r1564779269

The goal is to put the unicode_latex variable in an R script, to replace the current binary form stored in R/sysdata.rda.

This would also avoid the need of the globalVariables() call for unicode_latex as a hack to bypass R CMD check notes.

elong0527 commented 2 months ago

Based on our discussion, it might trigger issues with special characters. Would consider to keep it as is.

yihui commented 2 months ago

Special characters written in the form \Uxxxx should be fine for R CMD check (here is an example). Alternatively, they can be encoded to integers via utf8ToInt() and converted back to UTF-8 via intToUtf8(). Technically I guess the problem is solvable, but I understand it's no big deal, so I'm okay with leaving it alone.