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

Ross Moore ross at ics.mq.edu.au
Thu Aug 2 22:42:43 EDT 2007


Hi Chris,

On 03/08/2007, at 2:24 AM, Chris Goedde wrote:

> Hi Ross,
>
> Note, before I begin, I'll just say that I'm not upset about this and 
> I recognize that reasonable people can have different opinions on this 
> issue :-). And thanks again to Williams Adams for providing a 
> workaround. With that said ...
>
> On Aug 1, 2007, at 6:47 PM, Ross Moore wrote:
>
>> 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.
>
> It's pretty clear to me that filenames should be parsed from 
> right-to-left, not left-to-right when looking for extensions, and that 
> any program that doesn't do this is broken. (I don't really care about 
> the tiny number of file systems that can't handle . in a filename.) 
> This is a pretty trivial fix for any code still under development; for 
> such programs, choosing to remain broken is exactly that, a choice.
>
> BTW, is this bug, um, I mean feature, in pdflatex or in graphicx? If 
> it's in graphicx maybe I'll just try to fix it myself.

It isn't in  graphicx.sty  or  graphics.sty  .
The coding there simply looks for a file with the given name.
If not found, it successively *adds* extensions .png  .pdf  .jpg , in 
case
the filename was given without this, and looks for a file with the new 
name.

So any filename problems must come from the  pdftex  executable 
itself...

(However, if there is a  space  in the name, there can be a problem with
the coding in  graphics.sty ,  as this is assumed to be the delimiter 
for the
end of the filename.)

> At one time, tex (probably web2c, actually) turned foo.bar.tex into 
> foo.dvi, not foo.bar.dvi. That eventually got fixed, thank dog. No, I 
> don't remember anymore why I had a tex file with a . in the name, I'm 
> sure there was a good reason, though.

  ... as was the case here.
A new version of pdftex has just been announced.

>
>>    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
>
> Yes, I could continually munge all my pdf file names, it's true. They 
> are all created in Matlab programatically
> (e.g. via sprintf('foo-%.2f.pdf', variable_name). I could add some 
> logic after that to parse the name myself

I'm not sure of the syntax here, but it looks like using
       sprintf('foo-%_2f.pdf', variable_name)
would change the offending '.' to something else
and the problem would just melt away at it's source.

Maybe you meant     sprintf('foo-%2f.pdf', variable_name)
with   variable_name   referring to a number ?
Then you need to change this to a string and alter it before printing 
the string.
(This is a typical issue with automatic type-casting. What you get may 
not
actually be best for how you want to use the result.)

> and munge it to work around this bug, ugh! I'll stick with the 
> workaround that William Adams suggested.
>
>> 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?
>
> It's 2007, I'm tired of catering to MSDOS 1.0.

But it is not your choice what your collaborators work with,
or the publishers of the books that you write.

My point is that when you know that there is a possible problem,
however trivial it may seem, then it is best to adopt working methods
that cannot fail in that way.


Have you ever had a publisher/printer object that some graphics
in your book use the RGB colour model, even though only black, white
or shades of gray are all that is actually used?
*You* have to fix this problem, not them.

Seems trivial, and a problem that they should have an easy fix for;
but the longer you argue about it then the longer is your book delayed
from getting into print.


>
> Just my $0.02!
>
> -- 
> Chris Goedde


Cheers,

	Ross


------------------------- Helpful Info -------------------------
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/





More information about the MacOSX-TeX mailing list