6

I am including some jpeg images in a LaTeX file using \includegraphics. Is there a way I can bundle the image files with the source file, and so just send one file to other machines, or collaborators?

The comment by Aditya to Can you embed an image so it doesn't need to be stored as a separate file? seems to be to my point. But it does not tell me what I need to know. I am already using \includegraphics. My question is how to copy the relevant files.

I'm afraid David Carlisle is right that you really cannot bundle the files. But sending them separately by cloud or any other method raises the problem of getting MiKTeX to locate jpeg files. MDR's solution at \includegraphics -- file not found, even when in same directory, using FNDB, works intermittently for me. But even on a single machine it is not reliable. I do not want to depend on it between several different machines.

David, can you give your comment as an answer?

  • 3
    in general no, just send a zip archve of all the files. TeX can write text files so (some) EPS files you can include in the file and write with filecontents environment. – David Carlisle Feb 23 '14 at 21:22
  • 4
    Not only it is not a good practise, but also embedding all your source files into one is not advised. It is recommended to break your code into several files for different chapters, or to separate definitions and styles from actual text. – Hasan Zakeri Feb 23 '14 at 21:25
  • My specific problem now is lecture slides which need to work on a different machine than I use to create them. I can use article format, if Beamer has trouble with graphics (I don't know about that). But if i have to send each graphic as a separate file that is a nuisance. I might have to use MSWord instead. – Colin McLarty Feb 23 '14 at 21:31
  • 2
    Why don't you use a cloud service to sync your data between the machines? – Tobi Feb 23 '14 at 21:44
  • 2
    I can't answer your question as stated, but it is trivial to use bundledoc for the general goal, with or without arlatex. I once answered a question about this that you might find useful. – jon Feb 23 '14 at 22:31
  • I don’t understand. The beamer slides are contained in a single PDF file that also includes the graphics. You’d only need the pictures where you need your .tex files. There’s kind of a solution for OS X. – Crissov Feb 24 '14 at 09:33
  • @Crissov I see what you mean. The problem is I often revise my slides just before the talk. – Colin McLarty Feb 24 '14 at 14:35
  • What I do is to have the whole shebang in a git repository, which I push to a (private) server, or which I just pull from the other machines directly when needed. Has the nice extra that so I can go back to the version I gave a fwe years back. – vonbrand Feb 25 '14 at 18:50
  • 1
    Well, one way is redo all the images you have in TikZ and keep the code for all them as they should appear in the main file. – leo Feb 27 '14 at 20:47

1 Answers1

4

In general no, just send a zip archive of all the files. TeX can write text files so (some) EPS files you can include in the file and write with filecontents environment.

David Carlisle
  • 757,742
  • Technically it is possible to embed all kinds of binary data using base64 encoding. Here is a snippet by Paulo Cereda demonstrating how to do it: https://gist.github.com/cereda/1046388

    But I believe that this is hardly a solution to the OP's problem, because the real problem appears not to be how to embed data in text files, but rather how to keep working directories in sync.

    – DG' Aug 19 '14 at 13:03
  • @DG' yes or uuencode (or vvencode if you remember that;-) I didn't mention that intentionally as if you want latex to unpack that you need shell-escape or a custom graphics driver setup, either of which is more bother than simply unzipping a zip file. – David Carlisle Aug 19 '14 at 13:44