[R] PicTeX output: how to suppress escaping of $ signs and braces?

Dan Hatton vi5u0-r at yahoo.co.uk
Tue Sep 25 11:28:00 CEST 2007


On Tue, 25 Sep 2007, Prof Brian Ripley wrote:

> R is trying to do device-independent graphics and produce the same
> annotation output on any graphics device.  It assumes that when you
> write '$' you want a dollar sign, and so on.  Also, it needs to be
> able to render the text to find its bounding box (and baseline) and
> so place it accurately.  The necessary escaping is done in C in the
> pictex() device, and it is not optional.  You would need to make a
> modified version of the pictex() device to alter this, but you would
> still have the problem that the precise placement is done at a much
> higher level in code common to all devices.

Ah, OK, thank you.  So, necessity being the mother of invention, I've
worked around this with

hist(Peaklist$V3,xlab="\\histogramxlabel",ylab="\\histogramylabel")

then put in my LaTeX file

\newcommand{\histogramxlabel}{Height $z/\ut{mm}$}
\newcommand{\histogramylabel}{Probability density $\phi{}(z-z_0)/(1/\ut{mm})$}

-- 

Thanks again,

Dan Hatton

<http://www.bib.hatton.btinternet.co.uk/dan/>



More information about the R-help mailing list