On 24-Oct-09 20:28:04, Barry Rowlingson wrote: > On Sat, Oct 24, 2009 at 9:09 PM, Marius Hofert <m_hof...@web.de> wrote: >> Dear R-Users, >> >> I have the following problem: I would like to create a postscript >> file containing an r-plot with the string "\\vartheta" in it >> (reason: this is later converted to the TeX-string "\vartheta" >> and a vartheta is printed in the figure). In the minimal example >> below, the problem is that the created postscript file does _not_ >> contain the string "\\vartheta" as a whole, but rather the following >> code: >> ... >> 284.38 36.00 (\\v) 0 ta >> -0.300 (ar) tb >> 0.480 (theta) tb gr >> ... >> The problem is, that the program which converts the created .ps file >> to a >> .tex file does not understand this disrupted string. Why does the >> dev.copy(postscript,..)-command produce such an output and how can I >> prevent >> it from doing so? If I use a different string such as "\\v_i", then >> everything works fine and "\\v_i" appears as a whole string in the >> postscript file. So why does it not work for "\\vartheta"? > > Because postscript() doesn't know what you want to do with \vartheta, > and thinks you want to typeset the text itself. So it very cleverly > adjusts the spacing between the letters to look nice - this is called > 'kerning'. This means the text has to be set by postscript in several > parts. > > You can do greek characters in plots - see help(plotmath). > > Barry
To follow up: The issue is indeed kerning, and the way to avoid this happening is to use useKerning=FALSE in the call to postscript(), or to dev.copy(postscript,...) or to dev.copy2eps(). See the fairly recent thread "ridiculous behaviour printing to eps: labels all messed up!" starting at http://finzi.psych.upenn.edu/Rhelp08/2009-June/200664.html where the problem is quite extensively discussed. Hoping this helps, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.hard...@manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 24-Oct-09 Time: 21:53:23 ------------------------------ XFMail ------------------------------ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.