[R] sweave problem with special danish characters

Duncan Murdoch murdoch.duncan at gmail.com
Wed Aug 8 16:43:29 CEST 2012


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



More information about the R-help mailing list