[Tikzdevice-bugs] problems with accents

Jacques ROPERS jropers at gmail.com
Sun Oct 23 18:20:58 CEST 2011


Hello,

I have an issue with tikzdevice when using accented characters which is
illustrated in the script below. This UTF8 encoded script runs correctly
using
> Sweave('minimal.rnw', encoding="UTF-8")
and the result can be compiled with XeLaTeX. However, when I replace  "e" by
"é" in plot(rnorm(10,1,1), main ="e"), then I get the following error
message from R :

In getMetricsFromLatex(TeXMetrics) :
  XeLaTeX was unable to calculate metrics for some characters:
	 Missing character: There is no � in font ec-lmbx10!

Am I doing something incorrectly ?

Thanks for your help and for this nice package.
Regards,
Jacques


##########################

\documentclass{article}
\usepackage{Sweave}

\usepackage{fontspec}
\usepackage{tikz}


\begin{document}
éàè     %these accents are displayed correctly

<<label = debut, echo=FALSE, results=hide >>=
options(tikzMetricsDictionary = "metrics")
options(tikzLatex = "xelatex.exe")
options(tikzDefaultEngine = "xetex")
options(tikzDocumentDeclaration = "\\documentclass{article}")
options( tikzLatexPackages = c(
"\\usepackage{fontspec}"
,"\\usepackage{tikz}"
,"\\usepackage{calc}"
,"\\usepackage{color}"
))


require(tikzDevice, quietly=TRUE)
@



<<label = plot, fig=FALSE, echo=FALSE, results=hide>>=
tikz(file="plot.tex", standAlone=FALSE, bareBones=TRUE, width=5, height=6)
plot(rnorm(10,1,1), main ="e") ### Problem here if "é" instead of "e"
dev.off()
@


\begin{tikzpicture}[x=1pt,y=1pt]
\input{plot.tex}
\end{tikzpicture}

\end{document}


More information about the Tikzdevice-bugs mailing list