[R] ggplot2 and tikzDevice : problems with accents

Jacques Ropers jropers at gmail.com
Sun Oct 22 17:56:12 CEST 2017


Hi all,

I can't fathom why the accented "é" in the following ggplot2 graph makes 
R hangs when using tikzdevice,  whereas it works using simple pdf device.

######
library(tikzDevice)
library(ggplot2)

options(tikzDefaultEngine = "luatex")


tikzLualatexPackages =c(
   "\\usepackage{tikz}\n",
   "\\usepackage[active,

tightpage,psfixbb]{preview}\n",
   "\\usepackage{fontspec,xunicode}\n",
   "\\PreviewEnvironment{pgfpicture}\n",
   "\\setlength\\PreviewBorder{0pt}\n"
)


x<- rnorm(10)
y<- rnorm(10)
df <- data.frame(x=x, y=y)

#### This example works
tikz(standAlone = TRUE)
ggplot(df, aes(x=x, y=y))+geom_point() +xlab("e")
dev.off()
####

#### This example hangs and never completes
tikz(standAlone = TRUE)
ggplot(df, aes(x=x, y=y))+geom_point() +xlab("é")
dev.off()
####

#### Working OK when using pdf device
pdf()
ggplot(df, aes(x=x, y=y))+geom_point() +xlab("é")
dev.off()
####

Thanks for your help

Jacques


	[[alternative HTML version deleted]]



More information about the R-help mailing list