[OS X TeX] The `%!TEX TSprogram = TeXify' line used in TeXShop ...

Anthony Morton amorton at fastmail.fm
Thu Feb 14 01:43:07 EST 2008


> For decades just %! has been the "magic number" for Postscript files  
> and Postscript data streams.  Any additional data after the %!  
> simply specifies additional information about the Postscript code  
> contained in the file and is not required.

Actually, %! has been used as a lazy identifier for *non-conforming*  
Postscript - any conforming Postscript has to start with %!PS-Adobe- 
<num> at the very least.  Even most non-conforming Postscript will  
start with a %!PS identifier.

> It is TeXshop, with its %!TEX, that is at fault. This is not a  
> "magic number" used to identify a type of file. It is a TeXShop hack  
> attempting to pass various parameters to TeXShop from source files  
> and is incompatible with the use of magic numbers.

OK, but this heinous crime isn't specific to the TeXShop team - the  
Sunclock people have used %!VMF for their vector map files for years  
and this is recognised in the magic file distributed on most systems.   
It's a fairly intuitive way to specifiy a file format for any language  
that uses % for comments.

> The developers of TeXShop really need to change %!TEX to something  
> else, %%!TEX has been suggested on this list. Of course, this would  
> cause backward compatibility issues for some TeXShop users. Those  
> affected should not blame anyone but the developers of TeXShop who  
> did not consider all of the ramifications of using %!TEX.

But of course the file still won't be identified as LaTeX source  
unless you add the %%!TEX or whatever to the magic file - it's still  
expecting /documentclass or some similar command on the first line of  
the file.  If you have to modify the magic database anyway you might  
as well get it to recognise %!TEX which has been established as a de  
facto standard for some time now.

It's long been recognised that the magic-number system is fragile and  
anyone relying on it needs to be on the lookout for special cases that  
require updating the database.

Tony M.




More information about the MacOSX-TeX mailing list