Hi, I'm new in Latex and I'm trying to include an R chart into a Latex document. This is what I'm doing: 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps 2) In Latex (using TexWorks on windows xp) : In the preambule: \documentclass[11pt]{article} \usepackage{graphicx} \begin{document} blah..blah…blah \begin{figure} \centering \includegraphics{C:/xxx/Density.eps} \label{fig:Density} \end{figure} --This is the Error Message I'm getting: LaTeX Warning: File `R:/MarsTH/Studies/Misc/LIA QA/R/Density.eps' not found on input line 26. ! LaTeX Error: Unknown graphics extension: .eps. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. I'll appreciate your help. Thanks in advance, Lars. [[alternative HTML version deleted]]
On Thu, 25 Feb 2010, Lars Bishop wrote:> Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex > document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps > > 2) In Latex (using TexWorks on windows xp) : > > In the preambule: > > \documentclass[11pt]{article} > \usepackage{graphicx} > \begin{document} > > blah..blahblah> > \begin{figure} > \centering > \includegraphics{C:/xxx/Density.eps} > \label{fig:Density} > \end{figure} > > --This is the Error Message I'm getting: > > LaTeX Warning: File `R:/MarsTH/Studies/Misc/LIA QA/R/Density.eps' not found > on > > input line 26. > > ! LaTeX Error: Unknown graphics extension: .eps. >I've seen that message (recently, but on a Mac) when running pdflatex. Are you sure you don't have an option set that specifies using pdflatex rather than latex? HTH, Ray> See the LaTeX manual or LaTeX Companion for explanation. > > Type H <return> for immediate help. > > I'll appreciate your help. > Thanks in advance, > > Lars. > > [[alternative HTML version deleted]]
On 24/02/2010 6:29 PM, Lars Bishop wrote:> Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps > > 2) In Latex (using TexWorks on windows xp) : > > In the preambule: > > \documentclass[11pt]{article} > \usepackage{graphicx} > \begin{document} > > blah..blah?blah > > \begin{figure} > \centering > \includegraphics{C:/xxx/Density.eps} > \label{fig:Density} > \end{figure} > > --This is the Error Message I'm getting: > > LaTeX Warning: File `R:/MarsTH/Studies/Misc/LIA QA/R/Density.eps' not foundLaTeX generally doesn't work well with spaces in filenames. I'd save the graphic in the same directory as the .tex file (or a simple subdirectory of it, say "figs") and then use an include like \includegraphics{Density.eps} or \includegraphics{figs/Density.eps}> on > > input line 26. > > ! LaTeX Error: Unknown graphics extension: .eps.As Ray said, this is probably a pdflatex issue. Unfortunately, latex can handle eps but not pdf, and pdflatex can handle pdf but not eps. This is why Sweave produces both by default. If you do the same, then you could use \includegraphics{Density} with no extension, and both systems would look for extensions they recognize. Duncan Murdoch> > See the LaTeX manual or LaTeX Companion for explanation. > > Type H <return> for immediate help. > > I'll appreciate your help. > Thanks in advance, > > Lars. > > [[alternative HTML version deleted]] > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at 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.
Use \usepackage{epsfig} after your \documentclass. Then make sure to run LaTex not PDFLaTex On Wed, Feb 24, 2010 at 3:29 PM, Lars Bishop <lars52r at gmail.com> wrote:> Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps > > 2) In Latex (using TexWorks on windows xp) : > > In the preambule: > > \documentclass[11pt]{article} > \usepackage{graphicx} > \begin{document} > > blah..blah?blah > > \begin{figure} > \centering > \includegraphics{C:/xxx/Density.eps} > \label{fig:Density} > \end{figure} > > --This is the Error Message I'm getting: > > LaTeX Warning: File `R:/MarsTH/Studies/Misc/LIA QA/R/Density.eps' not found > on > > input line 26. > > ! LaTeX Error: Unknown graphics extension: .eps. > > See the LaTeX manual or LaTeX Companion for explanation. > > Type H <return> for immediate help. > > I'll appreciate your help. > Thanks in advance, > > Lars. > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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. > >
Lars Bishop-2 wrote:> > Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex > document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps >So, to be clear, your graphic is saved on the C drive. Lars Bishop-2 wrote:> > 2) In Latex (using TexWorks on windows xp) : > > In the preambule: > > \documentclass[11pt]{article} > \usepackage{graphicx} > \begin{document} > > blah..blahblah> > \begin{figure} > \centering > \includegraphics{C:/xxx/Density.eps} > \label{fig:Density} > \end{figure} > > --This is the Error Message I'm getting: > > LaTeX Warning: File `R:/MarsTH/Studies/Misc/LIA QA/R/Density.eps' not > found > on input line 26. >And LaTeX is looking on the R drive. Not quite sure how to fix this as you did specify C:/xxx/Density.eps in your call to \includegraphics{}. TeX and LaTeX were developed in UNIX environments where there are no C drives or R drives that segment the file system-- everything is contained under "/". There may be some special way you have to enter Windows paths. Lars Bishop-2 wrote:> > ! LaTeX Error: Unknown graphics extension: .eps. >You said you were using TeXworks which uses pdflatex as the default compiler. pdflatex compiles directly from .tex to .pdf and supports a wide variety of graphic inputs *EXCEPT* for .eps as the warning message above indicates. The older method of compiling LaTeX documents is to use the latex compiler which produces a .dvi file, then running dvips to produce a postscript file and then running ps2pdf to produce a pdf file. The latex compiler *ONLY* supports .eps as a graphic input. Personally, I would stick with the pdflatex compiler and switch to using the pdf() device in R for your graphics output. Hope this helps! -Charlie Lars Bishop-2 wrote:> > See the LaTeX manual or LaTeX Companion for explanation. > > Type H <return> for immediate help. > > I'll appreciate your help. > Thanks in advance, > > Lars. >-- View this message in context: http://n4.nabble.com/R-Graphics-into-Latex-tp1568266p1568391.html Sent from the R help mailing list archive at Nabble.com.