[R] sweave problem with special danish characters

Jonas Hal JOH at brf.dk
Wed Aug 8 16:58:09 CEST 2012


I am using win xp, R 2.15.0 and texi2dvi from the tools package.

Regards
Jonas

-----Oprindelig meddelelse-----
Fra: Duncan Murdoch [mailto:murdoch.duncan at gmail.com]
Sendt: 8. august 2012 16:43
Til: Jonas Hal
Cc: r-help at r-project.org
Emne: Re: [R] sweave problem with special danish characters

On 08/08/2012 6:15 AM, Jonas Hal wrote:
> Dear all,
>
> I use Sweave to create my reports. my pdf output contains only NA's whenever my text contains special Danish characters like ø, ø and å. I have upgraded R from 2.13 to 2.15 and the scripts worked fine under R 2.13.
>
> Sweave("Test.Rnw", encoding = "utf8")
> texi2dvi("Test.tex", pdf = TRUE)
>
> %"Test.Rnw"
> \documentclass{article}
> \usepackage [danish]{babel}
> \usepackage[utf8]{inputenc}
> \begin{document}
> This is a test that works
> \end{document}
>
> %"Test.Rnw"
> \documentclass{article}
> \usepackage [danish]{babel}
> \usepackage[utf8]{inputenc}
> \begin{document}
> This doesn't æ ø å and pdf document only contains NA \end{document}
>
> Any suggestions?

I think you need to give more information.  I just tried it in 2.15.1 patched on Windows 32 bit, and it worked fine.  What OS are you using?
Is the file really encoded using utf-8?  What version of R were you using (there's no such thing as 2.15)?  Where did you find the texi2dvi function?  (There's one in the tools package, but it isn't normally attached.  Are you using that one, or your own?)

Duncan Murdoch
_________________________________________________________________________________________________________________________________________
BRFkredit sender e-mails og vedhæftede dokumenter i ikke-krypteret form. Hvis du ikke ønsker at modtage oplysninger fra BRFkredit pr. e-mail, beder vi dig meddele os det via brev eller e-mail. Denne e-mail kan indeholde fortrolig information. Hvis du modtager e-mailen ved en fejl, beder vi dig informere os om det hurtigst muligt. Samtidig beder vi dig slette e-mailen uden at videresende eller kopiere indholdet.



More information about the R-help mailing list