2

Attaching a file with attachfile2 and the following code:

\documentclass{article}

\usepackage{attachfile2}

\begin{document} \attachfile{test.txt} \end{document}

generates a .pdf-file, which can be opened with macOS Preview (Version 11.0). However, clicking or double clicking on the shown PushPin does nothing. Opening the same document with Adobe Reader or Firefox, it works as expected.

Further information:

  • Hardware: MacBookPro M1 (macOS Sonoma 14.2.1)
  • IDE: PyCharm (2023.3.3) with TeXiFy-Plugin (0.9.3)
  • Compiler: pdfLaTeX
  • LaTeX Distribution: TeX Live

Any suggestion on how to attach files that can be opened with macOS Preview?

manu
  • 123
  • 4
  • 3
    according to a sister stackexchange site preview does not support attachments so there is nothing you can do from latex to make it work https://apple.stackexchange.com/a/221914 – David Carlisle Feb 06 '24 at 10:17
  • I assume also embedding files don't work then. Setting up a server, store the files online and link them seems a little bit of an overkill. So hoping for future releases of macOS Preview where this is included is the way to go then... Thanks! – manu Feb 06 '24 at 10:21
  • I don't have a mac, and that answer is rather old so things may have changed, but I doubt it. But you might want to wait for a mac user to post an answer. – David Carlisle Feb 06 '24 at 10:24
  • 2
    @DavidCarlisle I do have a mac and can confirm it still doesn't work (macOS Sonoma) – Joseph Wright Feb 06 '24 at 10:30
  • 1
    Previewers based on Apple's PDFKit don't support the functionality, so neither Preview nor Skim. – egreg Feb 06 '24 at 10:57

1 Answers1

4

According to a sister stackexchange site preview does not support attachments so there is nothing you can do from latex to make it work https://apple.stackexchange.com/a/221914

egreg and Joseph have confirmed this is still the case on current systems.

David Carlisle
  • 757,742