Graphics, Figures & TablesError Inserting figures - convoluted paths

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
norcalangel
Posts: 12
Joined: Thu Feb 19, 2009 9:33 am

Error Inserting figures - convoluted paths

Post by norcalangel »

I am using a package called Sweave, in a program called R to run some statistical analysis and produce a tex file. Reproducible research and the like. Anyhow, this works great and I am having no problems until I try to include a figure.

The code I downloaded from a Professor in Germany, so it should be completely self contained. It is rather short so I will include it at the bottom of this post.

What I do is tell R the path where the *.Rnw file is, and have it run Sweave on it.

Code: Select all

setwd("D:\\Dissertation\\Ex\\IMV CAP")
Sweave("new5.Rnw")
This produces a new5.tex file and the graphics file (new5-002.eps & new5-002.pdf) in the same directory as the *.Rnw file.

There's one more catch. I'm using Notepad++ because I can submit lines into R, and latex in the same program with keystrokes. I use NPP often on multiple computers, so I have it installed in "D:\My Dropbox\Notepad++". This is slightly bothersome because when I compile a *.tex file, the pdf and assorted *.aux and *.log files end up in the NPP folder, not in the folder where the *.tex is located.

So I submit it from NPP using pdftex and it gives me the following error: File `new5-002' not found.

So now to get to the reason for my post. I've tried using \graphicspath with various paths; D:\Dissertation\Ex\IMV CAP, \Ex, copying the images into \Notepad++ in my Dropbox folder... Even tried including the full path name into the \includegraphics line. I can't figure out how to make this work. I should be able to have the graphics anywhere as long as I successfully tell latex where to find it right?

I really hope someone else out there can help me figure this out. If, that is, they can parse through what i'm doing and where I have things located. I know it may sound overly complicated, but believe me it works. Just as long as I don't have graphics. Somewhat unrealistic expectation.

Here's the code file.

Code: Select all

\documentclass[a4paper]{article}

\title{Sweave Example 1}
\author{Friedrich Leisch}

\usepackage{Sweave}
\begin{document}

\maketitle

In this example we embed parts of the examples from the
\texttt{kruskal.test} help page into a \LaTeX{} document:

\begin{Schunk}
\begin{Sinput}
> data(airquality)
> kruskal.test(Ozone ~ Month, data = airquality)
\end{Sinput}
\begin{Soutput}
	Kruskal-Wallis rank sum test

data:  Ozone by Month 
Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 6.901e-06
\end{Soutput}
\end{Schunk}
which shows that the location parameter of the Ozone 
distribution varies significantly from month to month. Finally we
include a boxplot of the data:

\begin{center}
\includegraphics{new5-002}
\end{center}

\end{document}
And here's the log file:

Code: Select all

This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (preloaded format=pdflatex 2010.8.29)  29 AUG 2010 20:50
entering extended mode
**D:/Dissertation/Ex/IMV*CAP/new5.tex
("D:/Dissertation/Ex/IMV CAP/new5.tex"
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, loaded.
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("D:\My Dropbox\Notepad++\Sweave.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\fontenc.sty"
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\t1enc.def"
File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 43.
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX
\Gread@gobject=\count87
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\ae\ae.sty"
Package: ae 2001/02/12 1.3 Almost European Computer Modern

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\fontenc.sty"
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\t1enc.def"
File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 43.
)
LaTeX Font Info:    Try loading font information for T1+aer on input line 100.

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\ae\t1aer.fd"
File: t1aer.fd 1997/11/16 Font definitions for T1/aer.
)))
(C:\Users\Robin\AppData\Roaming\MiKTeX\2.8\tex\latex\fancyvrb\fancyvrb.sty
Package: fancyvrb 2008/02/07

Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)
\FV@CodeLineNo=\count88
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count89
\FV@StepNumber=\count90
\FV@OutFile=\write3
))
No file new5.aux.
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
("C:\Program Files (x86)\MiKTeX 2.8\tex\context\base\supp-pdf.tex"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count91
\scratchdimen=\dimen105
\scratchbox=\box27
\nofMPsegments=\count92
\nofMParguments=\count93
\everyMPshowfont=\toks15
\MPscratchCnt=\count94
\MPscratchDim=\dimen106
\MPnumerator=\count95
\everyMPtoPDFconversion=\toks16
)
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <12> on input line 9.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 9.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 9.
LaTeX Font Info:    Try loading font information for T1+aett on input line 12.
 ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\ae\t1aett.fd"
File: t1aett.fd 1997/11/16 Font definitions for T1/aett.
)
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 12.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 12.


! LaTeX Error: File `new5-002' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.31 \includegraphics{new5-002}
                               
? H
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
? 
[1

{C:/Users/Robin/AppData/Local/MiKTeX/2.8/pdftex/config/pdftex.map}]
("D:\My Dropbox\Notepad++\new5.aux") ) 
Here is how much of TeX's memory you used:
 1605 strings out of 495285
 20792 string characters out of 3179878
 67435 words of memory out of 3000000
 4798 multiletter control sequences out of 15000+200000
 18299 words of font info for 45 fonts, out of 3000000 for 9000
 14 hyphenation exceptions out of 8191
 35i,6n,21p,259b,187s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files (x86)/MiKTeX 2.8/fonts/
type1/public/amsfonts/cm/cmr10.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/typ
e1/public/amsfonts/cm/cmr12.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/
public/amsfonts/cm/cmr17.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/pub
lic/amsfonts/cm/cmr7.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/public/
amsfonts/cm/cmsltt10.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/public/
amsfonts/cm/cmtt10.pfb>
Output written on new5.pdf (1 page, 73581 bytes).
PDF statistics:
 30 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply