From ripley at stats.ox.ac.uk  Wed Nov 19 19:33:56 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 19 Nov 2008 18:33:56 +0000
Subject: [Rd] (PR#13234) Problems with Sweave and
	pdf.options(encoding="ISOLatin7")
In-Reply-To: <fcb463950811190644s75cc163eke43d3d478a69ed34@mail.gmail.com>
References: <20081031093507.EF812282C76E@mail.pubhealth.ku.dk>	
	<alpine.LFD.2.00.0811190927060.20865@auk.stats.ox.ac.uk>	
	<fcb463950811190345s542bc666yd045fb01f013321a@mail.gmail.com>	
	<alpine.LFD.2.00.0811191349260.31289@auk.stats.ox.ac.uk>
	<fcb463950811190644s75cc163eke43d3d478a69ed34@mail.gmail.com>
Message-ID: <49245C14.8080909@stats.ox.ac.uk>

Just to close the loop on this, the following works in en_GB.utf8 on 2.8.0:

<<fig=TRUE,echo=TRUE,pdf.encoding=ISOLatin7>>=
pdf.options(enc="ISOLatin7")
ps.options(enc="ISOLatin7")
plot(rnorm(100),main="\u0105\u010D\u0117\u0119\u012F\u0161\u016B\u0173\u017E")
@

I think the point is that you can use different encodings for different
figures in one Sweave document.

But in R-devel you can now pass any option via the Sweave() call as I at 
least expected from the documentation.

Vaidotas Zemlys wrote:
> 2008/11/19 Prof Brian Ripley <ripley at stats.ox.ac.uk>:
>> On Wed, 19 Nov 2008, Vaidotas Zemlys wrote:
>>
>>> OK, the modified R code is:
>>>
>>>
>>> plot(rnorm(100),main="\u0105\u010D\u0117\u0119\u012F\u0161\u016B\u0173\u017E")
>>>
>>> It does not work correctly with Sweave, as I wrote in my email, I
>>> rechecked. And yes it works if only pdf is used.
>> It works for me in xpdf, but not Acroread 8.1.3.
> 
> Yes, I checked only with evince, and assumed, that Acroread will be
> similar. Acrobat 9 (on windows) shows the letters, but they are
> bunched up together. Changing the default family to URWHelvetica did
> not help either. So that rules out using pdf for me.
> 
>>> I did not find any mention about encodings in ?Sweave, ?RweaveLatex
>>> and ?Rtangle,  and Sweave manual and FAQ.
>> Yes, Sweave is supposedly frozen pending unbundling.
>>
>> Note that this does work (at least for me) in lt_LT.utf8: it is because you
>> were in fr_FR.utf8 that you had a problem.
>>
>> So I think the solution is actually pretty simple: use the correct locale.
>> I've changed R-patched to take the defaults from pdf.options(), but Sweave
>> should still be able to set them.
>>
> 
> Aah, this does not occured to me. I thought that because locale is
> unicode it should not matter which unicode letters I use. That is a
> not correct assumption.
> 
> Thank you for your answers,
> 
> 
> Vaidotas Zemlys


-- 
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



[Rd] (PR#13234) Problems with Sweave and pdf.options(encoding="ISOLatin7")
Prof Brian Ripley