encoding - Using Knitr engine in TeXshop but pdf plot labels with accented letters are incorrect -


I want to compile the following Rnw file which has the R plot of the normal density function.

\ documentclass {amsart} \ usepackage [a4paper] {geometry} \ usepackage [Italian] {babel} \ usepackage [utf8] {inputinc} \ usepackage [T1] {fontenc} \ usepackage { Lmodern}% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ & lt; & Lt; Setup, include = FALSE, cache = FALSE & gt; & Gt; = Opts_chunk $ set (dev = "pdf", comment = NA, fig.align = 'center', cache = FALSE, message = FALSE, background = 'white') option (replace.assign = TRUE, width = 85) knit_hooks $ Set (fig = function (first, option, environment) {if (before) par (mar) = c (4,4, .1, .1), cex.lab = .95, cex.axis = 9, Mgp = c (2, .7,0), tcl = - .3)}) @ & lt; & Lt; Ready-to-Data, Include = FALSE & gt; & Gt; = @% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \ Start {document} This is an Italian caption `` There is a conspiracy with Densita '' Is `` density '' & lt; & Lt; Norm, echo = false, fig = 4, fig. Hight = 3.5> gt; = = Curve (dnorm (x), -4, 4, xlab = 'z', ylab = 'densita')

The file contains UTF-8 encoding.

Then I compile the file with R and weave

  Root-A "library (knit); knit2pdf ('~ / desktop / label.Rnw') " 

The correct plot is a label" densita "(the density, the last letter in the Italian sense, has been emphasized).

I am using MacOSX 10.10 Yosemite and MyR locale

  & gt; SessionInfo () R Version 3.1.1 (2014-07-10) Platform: x86_64-apple-darwin13.1.0 (64-bit) locale: [1] en_US.UTF-8 / en_US.UTF-8 / en_US.UTF- 8 / C / N / US.UTF-8 / en_US.UTF-8 Attached Base Packages: [1] Statistics Graphics GDVolices UTIL dataset method is loaded by base namespace (and not attached): [1] Tools 3.1.1 < / Code> 

The problem comes from using TexShop. I have suggested knitr.engine here: and compile file labels. Rnw

Now the wrong label is found in the plot, i.e., "density" becomes "densit .." Although I get the right pronunciation characters in the text.

Why does anyone know?


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -