0

When a file is attached thanks to \textattachfile{⟨file⟩}{⟨text⟩} provided by attach(2) package, the file open by the link has same content but not same name as ⟨file⟩.

For instance, in the following MWE, I pretend the link will open foo.tex but it will open foo.tex.xxx instead, where xxx is a random string. The file open has the same content as foo.tex but, because of its strange extension, is not open as a .tex file by the underlying text editor.

\begin{filecontents*}{foo.tex}
\documentclass{article}
\begin{document}
Foo.
\end{document}
\end{filecontents*}
%
\documentclass{article}
\usepackage{xcolor}
\usepackage[color=black]{attachfile2}
\begin{document}
\textattachfile{foo.tex}{Link to `foo.tex'}.
\end{document}

Is there a way for a file attached by means of attach/attach2 package to be open with same name?

Denis Bitouzé
  • 9,652
  • 4
  • 27
  • 85
  • I don't get this problem using pdflatex from MiKTeX to compile. The Adobe Reader and SumatraPDF both open the embedded file correctly. Difficult to say, if your compiled PDF or your reader cause the problem on your system (?). – Thomas F. Sturm Oct 23 '15 at 07:47
  • @ThomasF.Sturm I'm using pdflatex from an up to date TeX Live 2015 on Linux and Evince as PDF reader. Indeed with Adobe Reader for Linux, no problem. With Okular, the link doesn't work as expected with a left click (it opens an annotation) and a right click only allows to save the file, not to open it. – Denis Bitouzé Oct 23 '15 at 08:00

0 Answers0