[Rd] Suggestion / patch to support more Unicode characters in R CMD Rd2pdf

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 11 17:15:01 CEST 2012

On 04/07/2012 22:01, Mikko Korpela wrote:
> Hi list,
> When using R CMD Rd2pdf, it is possible to set environment variable
> RD2PDF_INPUTENC to value "inputenx" and enjoy better support for UTF-8
> characters (see ?Rd2pdf). This enables LaTeX package "inputenx" instead
> of "inputenc".
> Even better support for UTF-8 encoded characters can be had by better
> using the facilities provided by inputenx and making R CMD Rd2pdf insert
> a line to its temporary .tex file: "\input{ix-utf8enc.dfu}". The
> instructions are found in section 1.2 "Unicode" of the inputenx manual:
> http://mirror.ctan.org/macros/latex/contrib/oberdiek/inputenx.pdf
> I suggest that R CMD Rd2pdf automatically insert
> "\input{ix-utf8enc.dfu}" to its temporary .tex file when a combination
> of inputenx and UTF-8 is detected. The attached small patch does that.
> A demo package is also attached (tarball built manually, not R CMD
> build). It uses some UTF-8 characters not supported without the patch: R
> CMD Rd2pdf gives an error, propagated from LaTeX. With the patch
> installed, R CMD Rd2pdf works OK when RD2PDF_INPUTENC=inputenx is set.
> For testing, unpack tarball and run R CMD Rd2pdf on the resulting
> directory. Tested on R development version r59731 running on Ubuntu
> 10.10 64 bit.

Thank you for the suggestion.  My concern is that an installation could 
have inputenx but not ix-utf8enc.dfu.  You can check for that at LaTeX 
level by \IFfileExists, as we already do for t2anenc.def.  Could you 
please modify your patch to do so.

And it is easiest if this is filed on bugs.r-project.org as a 'Wishlist' 
item: see the R FAQ.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list