[Tex/LaTex] Plot symbols from R as latex symbols

rsymbols

In a LaTeX document, I am including an image showing a plot generated by R, for example the result of a plot(x=1:5,y=1:5,pch=13). Is there a way to use this nice little symbol as a LaTaX character to use it in the regular text? It's #13 from this list.

To clarify, I am not looking for \otimes, which is a nice workaround. I am rather wondering if there is some package which has all the standard R symbols, including, say #14.

Best Answer

Another not-very-elegant solution, but you could save just the symbol in a small file and import it where needed. It seems likely that each different symbol might need tweaking, but here's an example in knitr format.

enter image description here

\documentclass{article}
\usepackage[margin=0.1in, paperwidth=2.3in, paperheight=2.6in]{geometry}
\parindent 0pt
\begin{document}
<<fig.width=2, fig.height=2, echo=FALSE>>=
par(mar=c(1,1,1,1))
plot(x=1:5,y=1:5, pch=13)
@ 

<<echo=FALSE, results="hide">>=
pdf('test.pdf', width=.2, height=.2)
par(mar=c(0,0,0,0))
plot.new()
plot.window(xlim=c(-1,1),ylim=c(-1,1), xaxs="i", yaxs="i")
points(0, -0.5, pch=13, cex=1)
dev.off()
@ 

Note that the \includegraphics[height=12pt]{test.pdf} used in this graphic is a circle with an X through it.
\end{document}