Graphics, Figures & Tables ⇒ Problem of photo when moving file
-
- Posts: 41
- Joined: Sun Apr 08, 2012 4:31 pm
Problem of photo when moving file
I am using texmaker and sometimes i have to move my file from folder to another. The problem is that i have many figures in this file so that every time i need to run the file after moving it I have to include these figures from the begining which wastes my time.
How can i solve this problem?
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 27
- Joined: Wed May 16, 2012 8:24 pm
Re: Problem of photo when moving file
-
- Posts: 41
- Joined: Sun Apr 08, 2012 4:31 pm
Problem of photo when moving file
.GerlofVito wrote:I keep my figures in the same folder as the tex file, so if I have to move the tex file, I can just move everything along with it. Is there a reason that you can't also move the figures into the new folder along with the tex file?
Hello, thanks for the response, as along as i move the file i have to specify the path of the figures.
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
Problem of photo when moving file
\includegraphics{photo}
if the photo is in the same folder as the document, or
Code: Select all
\includegraphics{figures/photo}
Code: Select all
\includegraphics{/home/user/document/figures/photo}
Code: Select all
\includegraphics{c:/documents/figures/photo}
-
- Posts: 27
- Joined: Wed May 16, 2012 8:24 pm
Problem of photo when moving file
\graphicspath{{./}{figures/}}
Notice that you can specify several folders with \graphicspath. And then to insert an image from the figures subfolder, you can just write this is the body of the document:
\includegraphics{photo1}
-
- Posts: 41
- Joined: Sun Apr 08, 2012 4:31 pm
Problem of photo when moving file
Thanks all for the help.
where should I use the command \graphicspath{{./}{figures/}}?GerlofVito wrote:Ah, I see. Assuming you were using absolute file paths, Stefan's advice will help. Another tip when using relative paths is to use the \graphicspath command in your preamble, so you can just give the file name of the image in the body of the document. For example, put this in the preamble:
\graphicspath{{./}{figures/}}
Notice that you can specify several folders with \graphicspath. And then to insert an image from the figures subfolder, you can just write this is the body of the document:
\includegraphics{photo1}
is it at the beginning of the document before the command \begin{document}?
Thanks again.