I am in an mildly unfortunate situation in which, because of the way I prepared the files automatically, I ended up with a file to be attached but also another file with the same name but ending in the .tex extension. It seems that when referring to a file inside TeX the file with the extension .tex is always preferred. For example:
If I have the files example.cpp.tex and example.cpp (no .tex extension), then with
\documentclass{article}
\usepackage{attachfile}
\begin{document}
\textattachfile{example.cpp}{link}
\end{document}
attachfile will attach example.cpp.tex instead of example.cpp. This seems to be also true for many LaTeX commands, such as \input, \include, embedfile etc.
How can I enforce to use the file specified and not the .tex terminated one in general or in particular for \attachfile?
(Note: the problem is not the double extension; the unexpected result will also happen with the files example and example.tex.)
.texwill be appended to the file name, as with\input, if no extension is given explicitly. But this shouldn't affect file names with extensions… – Andrey Vihrov Aug 03 '11 at 06:38rename 's/\.cpp\.tex/-cpp.tex/'in a unix terminal. Much better than trying to fix this through tex – Seamus Aug 03 '11 at 10:13