[R] Problem displaying greek symbols

David Winsemius dwinsemius at comcast.net
Sun Jan 31 02:17:12 CET 2016


> On Jan 30, 2016, at 3:24 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> 
> (Ill give it a try, but more expertise than I have may be needed)
> 
> Works fine for me (on OS X).
> 
> Take a look at ?pdf . I believe the font family in use (Helvetica is
> the default) needs to have the (Adobe) symbol font as font 5. What
> family are you using?
> 
> To see what families are available, use:
> 
> names(grDevices::pdfFonts())

That's not very informative, since the actual fonts that are going to be used are inside the 'serif', "sans", and  "mono" families. Try this instead:

> pdfFonts()$serif$metrics
[1] "Times-Roman.afm"      "Times-Bold.afm"       "Times-Italic.afm"    
[4] "Times-BoldItalic.afm" "Symbol.afm"      

> pdfFonts()$mono$metrics
[1] "Courier.afm"             "Courier-Bold.afm"       
[3] "Courier-Oblique.afm"     "Courier-BoldOblique.afm"
[5] "Symbol.afm" 

Notice the the fifth item in both is Symbol.

Which may also not be very useful either since for reasons that I have never been able to fathom, the fonts sometimes get messed up on a Mac and the way to detect and correct the problem is to use Font Book.app which I think you will find in either ~/Applications or ~/Applications/Utilities. The symptom: ... you find a font type in Font Book that has duplicate entries. Delete the corrupted one and you may find your Symbols will reappear.

(This is documented in ?quartz.)


> Another possibility is that you are using the wrong encoding.
> Unfortunately, this is beyond my ability to help you with, but perhaps
> reading the Help on the encoding argument and related links might get
> you the necessary info.
> 
> Cheers,
> Bert
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Sat, Jan 30, 2016 at 1:43 PM, Jorge Fernández García
> <jorfega80 at hotmail.com> wrote:
>> Hi,
>> 
>> 
>> I have a problem displaying greek (and in general any special character).
>> 
>> 
>> I know I am using the right command as the same script works in Fedora20 but not in MAC Yosemite.
>> 
>> 
>> ylab=expression(delta) displays a square instead of the right symbol when I view the resulting pdf file with preview or any other tool to display pdf.

A full test would be:

pdf(); plot(1,1, main=expression(delta)); dev.off()

-- 
David.

>> 
>> 
>> Any idea of what's going on?
>> 
>> 
>> Thanks in advance
>> 
>> 
>> 
>>        [[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list