# [OS X TeX] graphicx, pdflatex and pdf file names

Ross Moore ross at ics.mq.edu.au
Wed Aug 1 19:47:37 EDT 2007

```Hi Chris,

On 02/08/2007, at 6:32 AM, Chris Goedde wrote:

> On Aug 1, 2007, at 3:16 PM, William Adams wrote:

>> I think the command you want is \DeclareGraphicsRule{*}{pdf}, which
>> then has any unknown extension treated as a .pdf.
>
> Okay that works, thanks. The full syntax is
>
> \DeclareGraphicsRule{*}{pdf}{*}{}
>
> in the preamble, and the line
>
> \includegraphics[width=3in]{Figs/Simulations/Aggregate/Correlation-WP
> -12.80.pdf}
>
> in the file.
>
> There's still a bug though, pdflatex/graphicx (not sure which)
> shouldn't be parsing the file as having extension .80.pdf, I don't
> think, but as having extension .pdf. (The above workaround just tells
> graphicx to pretend that a file with 'extension' .80.pdf the same as a
> file with extension .pdf.) Maybe others disagree that this is a bug,
> though.

Yes; I disagree that it is a bug.
The problem lies in the choice of having a '.' in the filename, other
than for the extension.
Even if you have lots of these, it is just a few minutes work to
collect all the names
and write a short script that changes them all; e.g., with
command-lines like:

mv  Simulations/Aggregate/Correlation-WP-12.80.pdf
Simulations/Aggregate/Correlation-WP-12_79.pdf
mv  Simulations/Aggregate/Correlation-WP-12.80.pdf
Simulations/Aggregate/Correlation-WP-12_80.pdf
mv  Simulations/Aggregate/Correlation-WP-12.80.pdf
Simulations/Aggregate/Correlation-WP-12_81.pdf

You may think that because a filename such as  Correlation-WP-12.80.pdf
is valid for the
filesystem, then other software should handle it correctly.
Nice ideal, but unfortunately there is a lot of otherwise good software
around
which barfs at this point.  Not surprising, since that would not have
been a valid
filename in some previous OSs, and may still continue to be invalid in
some.

Have you tried to send a PDF with such a name as an attachment to an
email message?
Try it; send to yourself. Then try to look at the image full-size in
Apple's Mail.app
(via a double-click) or with other mailers.
This may actually work for you under OS X, where PDF is essentially a
native format;
but will it work for other people, using other systems?

Recently I had a problem with a .doc file named with extra '.'s in the
prefix.
Some mailers could open the attachment, others (incl. Mail.app) could
not.
Solution:  save it and rename it!

Hope this helps,

Ross

>
> --
> Chris Goedde
>
>
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
> List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
>
>