Brew and knit one PDF report split by variable with special characters (å æ ø) - encoding issue

后端 未结 1 1480
-上瘾入骨i
-上瘾入骨i 2021-01-12 08:29

I try to produce one PDF report split on sections based on a grouping variable, using brew and knitr. My grouping variable may contain special char

相关标签:
1条回答
  • 2021-01-12 08:44

    Since you are using UTF-8, which is not the native encoding of your OS, you need to explicitly tell knitr the encoding of your input document. For example, you have to call

    knit2pdf(brew_out, encoding = "UTF-8")
    

    But I'm not sure if brew can handle non-native character encodings. If not, I suggest you use your system default encoding (should be ISO8859-1 in this case), and

    \usepackage[latin9]{inputenc}
    

    Or do everything in knitr if you have to use UTF-8 (this also enables you to click the button to compile the document); see 075-knit-expand.Rnw for an example.

    0 讨论(0)
提交回复
热议问题