You can attach a local file such as picture or text file as part of a PDF or doc file, when you send it to other people or copy this file to other computer or place, the attachment will be one part of the PDF or doc file and you can open it even you don't have the attachment in your local disk, I wonder if this is possible when writing org-mode file using Emacs.
-
Please don't do that. What's wrong with creating an archive of all needed files? – wasamasa May 18 '15 at 06:27
-
Creating an archive needs creating and archive, I just wonder if this is possible, there are org-attach-xx commands but they are not doing as I expected. – CodyChan May 18 '15 at 06:55
-
It sure is possible, but makes it needlessly difficult for others to work with the attachments. – wasamasa May 18 '15 at 07:08
1 Answers
Org-mode files are plain text, by design, and Org therefore has no native facilities for attaching binary files. (The org-attach
family of commands copy the attachment into a subdirectory of the current directory, and are therefore unrelated to what you are asking.)
Of course, there's nothing preventing you from encoding your binary file as plain text (using e.g. the base64
utility, or the older uuencode
program) and including it in the Org-mode file. However, this will make the Org-mode file extremely large, and you risk corrupting the encoding data if you're not extremely careful.
As pointed out by wasamasa, it is a better choice to create an archive (using tar
, zip
or 7z
) that contains the Org-mode file and the related files. By using archive-mode
, you can edit the Org-mode file within the archive itself, without needing to manually update the archive each time.

- 5,680
- 22
- 39