[R-pkg-devel] Intrinsic UTF-8 use in aspired CRAN package

Schuhmacher, Dominic dom|n|c@@chuhm@cher @end|ng |rom m@them@t|k@un|-goett|ngen@de
Fri May 19 19:54:27 CEST 2023


Thanks again! I see now that having Japanese characters in the pdf help is much more difficult to put into practice than I thought.

I can imagine that it is not desirable for CRAN package checks if packages try to set all sorts of environment variables that make them perform in unpredictable ways. On the other hand it seems that there might be some interest to display characters of major writing systems (which may well occur as the subject matter of packages) also in the pdf help. So maybe the solution is to allow for a file in the man folder that allows to specify other flavors of latex and makes injections into the preamble (I might turn this into a better formulated feature request at some later point...)

I have checked out other Japanese script related packages on CRAN and it seems the common solution is to use potentially long sequences of \u escapes (which will then only be rendered as numbers of course). For now I will do the same, i.e. just run a script on the .Rd files that replaces CJK characters by their escape values before submitting to CRAN (and keep the other variant on GitHub). 

Best regards,
Dominic



> On 19. May 2023, at 10:51, Ivan Krylov <krylov.r00t using gmail.com> wrote:
> 
> В Thu, 18 May 2023 12:48:01 +0000
> "Schuhmacher, Dominic"
> <dominic.schuhmacher using mathematik.uni-goettingen.de> пишет:
> 
>> By the way, what is the recommended way of setting environment
>> variables like PDFLATEX and (possibly) RD2PDF_INPUTENC in a package
>> (if this is something that is allowed on CRAN)? 
> 
> I don't think there is a supported way of doing that. It would have to
> affect quite a lot of cases of rendering help pages, including
> help(help_type = 'pdf').
> 
> For better or worse, environment variables set from inside
> \Sexpr[stage=render]{...} currently persist until texi2pdf() is run,
> but that's intrusive because it affects all following texi2pdf() calls
> from the same process.
> 
> Perhaps it's worth discussing as a feature request on R-devel?
> 
> -- 
> Best regards,
> Ivan




More information about the R-package-devel mailing list