Featured Book

LaTeX Beginners Guide

Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 18 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Graphics File in custom Folder not found Topic is solved

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

Graphics File in custom Folder not found

Postby Yashar on Sun Nov 18th, 2012

Hi,

I'm using TeXnicCenter editor with MikTeX 2.9. I want to insert a PDF page, that I called "abc.pdf", in my PDF document. I opened a folder and called it "myfiles", this is where all my source files and "abc.pdf" are. The code related to "abc.pdf" is the following:
Code: Select all  •  Open in writeLaTeX
\makeatletter
\AddToShipoutPictureBG*{
  \setlength{\@tempdimc}{.06\paperheight}
  \setlength{\unitlength}{1pt}
  \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
    \includegraphics{abc.pdf}
  }
}
\makeatother

But when I compile the document from Latex to PDF, "abc.pdf" does not appear in my document and I get the error message:
Code: Select all  •  Open in writeLaTeX
Package pdftex.def error: file "abc.pdf" not found.

By the way, I am sure that there is nothing wrong with the code.
Thanks
Yashar
 
Posts: 3
Joined: Sun Nov 18th, 2012

Re: Graphics File in custom Folder not found

Postby hugovdberg on Sun Nov 18th, 2012

Could you please clarify your directory structure? Is your main tex-file in the same folder as the abc.pdf? From what folder are you calling latex?
Furthermore please provide a compilable minimal working example, this snippet requires packages that are not mentioned in your post.
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
hugovdberg
 
Posts: 133
Joined: Sat Feb 25th, 2012
Location: 's-Hertogenbosch, Netherlands

Re: Graphics File in custom Folder not found

Postby Yashar on Mon Nov 19th, 2012

Ok, the document is my thesis. All chapters (tex files) of the thesis with the abc.pdf file are in one folder called "myfiles" and this folder is in My Documents. The main tex file is outside of this folder but still in My Documents.
The main tex file looks something like this:

Code: Select all  •  Open in writeLaTeX
\documentclass[11pt]{report}
\usepackage{pdfpages}
\usepackage{anysize,fancyhdr,graphics}
\usepackage{csthesis}
\usepackage{makeidx}  
\usepackage[titletoc]{appendix
}

\makeindex  
\makeatletter
\newcommand\otherlist{%
   \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\otherlistname
      \@mkboth{\MakeUppercase\otherlistname
}%
              {\MakeUppercase\otherlistname}}%
    \@starttoc{lop}%
    \if@restonecol\twocolumn\fi
    }
\newcommand*\l@program{\@dottedtocline{1}{1.5em}{2.3em}}
\newcounter{program}[chapter]
\renewcommand\theprogram{\thechapter.\@arabic\c@program}
\def\fps@program{tbp}
\def\ftype@program{3}
\def\ext@program{lop}
\def\fnum@program{\programname~\theprogram}
\newenvironment{program}
               {\@float{program}}
               {\end@float}
\newenvironment{program*}
               {\@dblfloat{program}}
               {\end@dblfloat}
\makeatother

\begin{document}
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
\figurespagetrue
\tablespagetrue
\dedicationpagetrue
\quotationpagetrue
\include{myfiles/title}
\newpage
\addcontentsline{toc}{chapter}{put whatever you like}
\mbox{}
\makeatletter
\AddToShipoutPictureBG*{
            \setlength{\@tempdimc}{.06\paperheight}
            \setlength{\unitlength}{1pt}
           \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){
        \includegraphics{abc.pdf}
        }
}
\makeatother
\newpage

\include{myfiles/abs}
\include{myfiles/ack}
\lists
\include{myfiles/int}
\beforetext
\include{myfiles/intro}
\include{myfiles/chap1}
\include{myfiles/chap2}
\include{myfiles/chap3}
\include{myfiles/chap4}
\include{myfiles/chap5}
\include{myfiles/bib}
\end{document
}


I downloaded the pdf page from internet and put it in that folder. So maybe that's not enough.
Yashar
 
Posts: 3
Joined: Sun Nov 18th, 2012

Re: Graphics File in custom Folder not found  Topic is solved

Postby hugovdberg on Mon Nov 19th, 2012

Have you tried changing the path to myfiles/abc.pdf? As far as I can see it is included from your main file.

When you include the abc.pdf from a file in myfiles you still have to give the path relative to your main file since the content of that file is sort of on-the-fly copy-pasted into the main file.
Another option is the currfile package which allows you to also include files relative to the included file. So if you have three files (main.tex, myfiles/included.tex and myfiles/abc.pdf) you can refer in included.tex to just abc.pdf as long as you use the package currfile.
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
hugovdberg
 
Posts: 133
Joined: Sat Feb 25th, 2012
Location: 's-Hertogenbosch, Netherlands

Re: Graphics File in custom Folder not found

Postby Yashar on Mon Nov 19th, 2012

Thank you so much, I just changed \includegraphics{abc.pdf} to \includegraphics{myfiles/abc.pdf} and it worked! So simple! Thanks again, you are awesome!
Last edited by cgnieder on Mon Nov 19th, 2012, edited 1 time in total.
Reason: inline code markup
Yashar
 
Posts: 3
Joined: Sun Nov 18th, 2012


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: No registered users and 18 guests