# [Tugindia] Re: using \includegraphics

Kumaresh P pskumaresh06 at gmail.com
Wed Mar 8 09:20:18 CET 2006

Dear All,

Have a great day!

I can give one idea, to include the figures those in separate folders.

Add the below command in preamble and add the figures path.

\graphicspath{
{Figures path, where the figures contains}
{Figures path, where the figures contains}
{Figures path, where the figures contains}
}

Example:

\documentclass{article}
\usepackage{graphics} % or graphicx
\graphicspath{
{dir1/}%if it didn't combile, then you add the full path
{dir2/}
}

\begin{document}
\includegraphics{figure.eps}
\includegraphics{figure1.eps}
\end{document}

Now you couldn't add the full path of the figure in every figure, but one condition figures name should not be same.

Thanks

Try this one.

Best
Kumaresh PS

_____________________________________________________________

David wrote:
_____________________________________________________________

Hi, Everyone,

I have a little problem which I think is trivial but I am unable to solve
it. It is as follows:

I wish to include graphics in a latex file. When I use the
"includegraphics.."  statement I find that the  .eps file has to be in the
same folder as the latex file. This is OK. But suppose I have several .eps
files with the same name and do not want to change the names. I have tried
putting them into different folders but have not been able to write the
correct filepath. I have made several attempts but they did not work.

Can someone tell me what to do? I will appreciate it very much.

Thanks.

D.Owen

_____________________________________________________________

"Raj Replied to David:"
_____________________________________________________________

David,

> suppose I have several .eps files with the same name and do not want to change the names. I   > have tried putting them into different folders but have not been able to write the correct filepath. I > have made several attempts but they did not work.

You need to give the full path or the relative path of the .eps files.
In Unix/Linux environment it is

\includegraphics{epsfiles/my1.eps}

Similar method is likely to hold true for Windows environment as well.
It will be

\includegraphics{epsfiles\my1.eps}

I hope this helps.

-- Raj

_____________________________________________________________

Josy's reply
_____________________________________________________________

On Tue, 2006-03-07 at 14:51 -0400, david wrote:
> I wish to include graphics in a latex file. When I use the
> "includegraphics.."  statement I find that the  .eps file has to be in the
> same folder as the latex file. This is OK. But suppose I have several .eps
> files with the same name and do not want to change the names. I have tried
> putting them into different folders but have not been able to write the
> correct filepath. I have made several attempts but they did not work.

It would be nice if you can provide the simplified sample LaTeX file so
that the problem (to me looks trivial) is clear. Check whether the
following serves your purpose.

\documentclass{article}
\usepackage{graphics} % or graphicx

\begin{document}
\includegraphics{dir1/figure.eps}
\includegraphics{dir2/figure.eps}
\end{document}

works perfectly for me. Note dir1 and dir2 can be in the same folder as
the LaTeX file or in the TEXINPUTS search path.

Regards.
--
Josy P. Pullockara



More information about the tugindia mailing list