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

Herbert Schulz herbs at wideopenwest.com
Fri May 14 00:09:47 CEST 2010


On May 13, 2010, at 4:46 PM, Jung-Tsung Shen wrote:

> On Thu, May 13, 2010 at 4:24 PM, Herbert Schulz <herbs at wideopenwest.com> wrote:
> 
>> Howdy,
>> 
>> Could you supply a minimal but compilable file and graphic that demonstrates this problem? Also, are you including the jpg extension when you use the \includgraphics command? That might be what is causing the problem since pdflatex is most likely finding the previous One_Way.pdf file and trying to include that.
>> 
>> Good Luck,
>> 
>> Herb Schulz
> 
> Herb,
> 
> Thanks for the reply. Here's a working (i.e., non-working) minimal:
> 
> **************
> %%!TEX TS-program = pdflatex
> \documentclass{article}
> \usepackage{graphicx}
> \begin{document}
> \begin{figure}[h]
>   \centering
>   \includegraphics[width=3in]{one_way}
>   \caption{Lala}
>   \label{fig:one_way}
> \end{figure}
> \end{document}
> ***************
> 
> The existence of a (any) figure file named one_way.jpg will work
> (i.e., not work). xelatex also encountered the same problem.
> 
> Thanks.
> 
> JT

Howdy,

It's exactly what I thought it was... you are NOT including the jpg extension in the \includgraphics command so it is finding an older One_Way.pdf before finding the one_way.jpg (case doesn't seem to make a difference here) and trying to use it. By simply adding the jpg extension pdflatex (and xelatex) will be happy.

%%!TEX TS-program = pdflatex
%%!TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
  \centering
  \includegraphics[width=3in]{one_way.jpg} % notice the .jpg extension!
  \caption{Lala}
  \label{fig:one_way}
\end{figure}
\end{document}

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list