[Rd] [R] ouml in an .Rd

Martin Maechler maechler at stat.math.ethz.ch
Tue Jan 10 12:27:29 CET 2006


>>>>> "PaulG" == Paul Gilbert <pgilbert at bank-banque-canada.ca>
>>>>>     on Mon, 09 Jan 2006 15:27:12 -0500 writes:

    PaulG> (moved from r-help) Ok, UTF-8 works on some of my
    PaulG> machines and latin1 on others. If I use one I get
    PaulG> failure or spurious characters when I build on the
    PaulG> wrong machine. Are .Rd files suppose to work on
    PaulG> different platforms when there are special
    PaulG> characters, 

yes, they are. That's why we have \encoding{} and \enc{}
nowadays, and the "Writing R Extensions" manual has been
documenting this for a while, currently [an excerpt:]

 >> 2.10 Encoding
 >> =============
 >> 
 >> `Rd' files  are text files  and so it  is impossible to  deduce the
 >> encoding they are written in: ASCII, UTF-8, Latin-1, Latin-9 _etc_.  So
 >> the  `\encoding{}' directive  must  be  used  to specify  the
 >> encoding: if not present the processing to HTML assumes that the file is
 >> in Latin-1 (ISO-8859-1).   This is used when creating  the header of the
 >> HTML conversion  and to make a  comment in the examples  file.  It is
 >> also used to indicate to LaTeX how to process the file (see below).
 >> 
 >>    Wherever possible, avoid non-ASCII chars in `Rd' files.
 >> 
 >>    For convenience, encoding names `latin1' and `latin2' are always
 >> recognized: these and `UTF-8' are likely to work fairly widely.

 >> ............................
 >> ............................


I'm a bit surprised that you haven't succeeded finding this
information in the extension manual.  
After all, it's  *the*  R manual for package writers.

Martin

    PaulG> or is this a known limitation?

(not at all)

    PaulG> Paul

    PaulG> Prof Brian Ripley wrote:

    >> It means what it says: you need to put the actual
    >> character in the file, and specify the encoding for the
    >> file via \encoding.  (For you, UTF-8 or latin1, I would
    >> guess.)
    >> 
    >> It's not a question of trying variations, rather of
    >> following instructions.
    >> 
    >> On Fri, 6 Jan 2006, Paul Gilbert wrote:
    >> 
    >>> I am trying to put an ouml in an .Rd file with no
    >>> success. Writing R Extensions suggests:
    >>> 
    >>> Text which might need to be represented differently in
    >>> different encodings should be marked by |\enc|,
    >>> e.g. |\enc{Jöreskog}{Joreskog}| where the first argument
    >>> will be used where encodings are allowed and the second
    >>> should be ASCII (and is used for e.g. the text
    >>> conversion).
    >>> 
    >>> (Above may get mangled by the mail.) I have tried
    >>> variations
    >>> 
    >>> \enc{J"oreskog}{Joreskog} \enc{J\"oreskog}{Joreskog}
    >>> \enc{Jo\"reskog}{Joreskog} \enc{Jo\"reskog}{Joreskog}
    >>> \enc{J\"{o}reskog}{Joreskog}
    >>> \enc{J\\"{o}reskog}{Joreskog}
    >>> \enc{J&ouml;oreskog}{Joreskog}
    >>> 
    >>> all with no effect on the generated pdf file.
    >>> Suggestions would be appreciated.
    >>> 
    >>> Thanks, Paul Gilbert
    >>> 
    >>> ______________________________________________
    >>> R-help at stat.math.ethz.ch mailing list
    >>> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
    >>> read the posting guide!
    >>> http://www.R-project.org/posting-guide.html
    >>> 
    >>

    PaulG> ______________________________________________
    PaulG> R-devel at r-project.org mailing list
    PaulG> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list