[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accents in postscript graphs
Gerald,
The general solution is to use psfrag in LaTeX. I added a little
function in the Hmisc library recently that saves just a bit of
typing. Here is an example where I use math mode for axis labels
and main title.
tex <- function(string, lref='c', psref='c', scale=1, srt=0)
paste('\\tex[',lref,'][',psref,'][',
format(scale),'][',format(srt),']{',string,'}',sep='')
setps(psfrag, toplines=1)
x <- seq(0,15,length=100)
plot(x, dchisq(x, 5), xlab=tex('$x$'),
ylab=tex('$f(x)$'), type='l')
title(tex('Density Function of the $\\chi_{5}^{2}$ Distribution'))
dev.off()
The Hmisc setps function uses nice defaults for making small postscript
graphs for reports and books.
The LaTeX code to insert this graph can look like:
\documentclass{article}
\usepackage[scanall]{psfrag}
\begin{document}
\begin{figure}
\includegraphics{psfrag.ps}
\caption{This is the example}
\end{figure}
\end{document}
Gerald.Jean@spgdag.ca wrote:
>
> Hello everyone,
>
> Splus-2000 on NT4
>
> I am trying to produce plots in postscript format for inclusion in LaTeX
> documents. I use "graphsheet" with format = "EPS", mostly because the
> resulting plots look better than using "postscript(...)", no problems with
> ticks labels' rotation, but, there is always a but it seems:
>
> I work in French, my documents are in French and the axis label's, titles
> and other text on the graphs should be in French, this is where the "but"
> comes in: I can't get an accented letter in those labels, titles or
> whatever? When I send the graph to the console, no problems I just replace
> the accented letters by their corresponding escape sequence, e.g. \351 for
> a ""; this also works well when I output the graph in "WMF" format and
> later imports it in Words or PowerPoint but not for "EPS"? Once the ".EPS"
> file is included in LaTeX and LaTeX compiles it the output is a postscript
> file that I can look at through Ghostview, all accented letters in the
> text, not the graph, are OK, LaTeX as converted them to their escape
> sequence (can be seen in the .ps file output of LaTeX), the accented
> letters of the graph are not OK, they look like a big O with a slash
> through it, but they look OK in the .ps file itself???
>
> Any idea on how to fix this?
>
> Thanks to all,
>
> Grald Jean
> Analyste-conseil (statistiques), Actuariat
> tlephone : (418) 835-4900 poste (7639)
> tlecopieur : (418) 835-6657
> courrier lectronique: gerald.jean@spgdag.ca
>
> "In God we trust all others must bring data"
>
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
--
Frank E Harrell Jr Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat
---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news