# [OS X TeX] pdflatex figure with the same name as the document?

Ross Moore ross at ics.mq.edu.au
Fri May 14 00:16:44 CEST 2010

```Hello Jung-Tsung Shen,

On 14/05/2010, at 6:43 AM, Jung-Tsung Shen wrote:

> I was pdflatexing a document named "One_Way.tex" just now. In the
> document, I have a figure named "one_way.jpg". The compilation failed
> numerous times (log attached below) and I thought the figure file was
> corrupted so also I re-made tons of times a new figure file but still
> in vain.
>
> Finally, I changed the name of the figure file to something else and
> it worked immediately. Is there a rule that the figure file can't be
> of the same name as the document?

Your job is called  One_Way.tex  so will result in  One_Way.pdf .
When you  \includegraphics{one_way}  then LaTeX looks for an
appropriate graphic file to include.
The usual order of precedence is:
one_way.pdf  >  one_way.png  >  one_way.jpg

Which one is found is now up to the file-system matching
provided by your operating system.
If  one_way.pdf   also matches   One_Way.pdf
then you are certainly going to have a problem.

I'm pretty sure that this will happen under Windows;
also it can happen on a Mac --- but I think there is a setting
to prevent it --- but not under Linux and other Unix flavours.

>
> JT

Hope this helps,

Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------

```

More information about the macostex-archives mailing list