I'm using XeTeX and I'd like to have a link to an attached/embedded file.
There's a solution here -- but it doesn't work for me: I'm using TeXlive2012.
As I understand it the best bet is to use attachfile2 package.
Here's an MWE:
\documentclass{article}
\usepackage[xetex]{attachfile2}
\begin{document}
\subsection{Test!}
Link: see \textattachfile{lagrange.png}{this citation}.
\end{document}
I can right-click on a link and save the file -- but it would be much nicer if I could just click the file and let the OS open it with the default application.
Edit:
If one attachs file with attachfile2 -- it behaves differenctly on different readers.
If one embeds a file:
\documentclass{article}
\usepackage{navigator}
\embeddedfile{lagrange}{lagrange.png}
\begin{document}
I attached a file -- called \texttt{lagrange.png}
\end{document}
some users won't find it.
So the most stable way is to put files to embed in a special dir, say in flz, and distribute the zip folder:
.
├── 1.pdf
└── flz
└── lagrange.png
code:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
See \href{run:flz/lagrange.png}{here}.
\end{document}
Then it's clickable and stable.
Edit 2:
I'm using attachfile2 as posted in the first MWE.
Couldn't open attachment “lagrange.png”: Failed to execute child process "eog" (Permission denied). It turns out thateogis an image viewer --eye of gnome-- and I have it installed. – Adobe Apr 29 '13 at 11:32navigatorit is not seen on some readers at all. If one attaches withattachfile2it behaves a little bit differently across readers, but still accessible. If one carries file thenhrefalways work. – Adobe Aug 15 '13 at 08:38hyperrefis only linking to a file, whereas bothattachefile2andnavigatorare actually embedding the file. The latter process sounds very much dependent on the viewer, and that sounds like what you're seeing. – Joseph Wright Aug 15 '13 at 08:42