Suppose you have a latex file (say test.tex) which a lot of includes (\includegraphics, \include, \includepdf, bibliography files, \includestandalone etc.) sometimes with relative, sometimes with absolute path's sometimes with graphics path set or with graphics environment variable etc. Included tex files may also include other files as well.
Is there a script say bundle tex.tex which creates a tar or zip file which contains a directory containing test.tex and all includes. This may be flattend i.e. all includes on the same hirarchy level and the includepathes adapted to just filename such that it compiles if it hand it over to someone else. It may be partially flattened (for example with a subdirectory of pictures) or organized in some other sensible way with adapted paths in the sources such that it compiles after unzipping without changing anything.
For example unzip testbundle.tar will result in a directory testbundle wich contains test.tex and all includes such that for example pdflatex test.tex works on a other machine without further intervention.
--excludeoption to exclude the location of your tex instalation, something like--exclude=/usr/local/texlive/*(this probably won't work, but maybe worth a try) – samcarter_is_at_topanswers.xyz Jan 11 '19 at 13:48bundledoc --exclude=/usr/local/texlive/ test.tex, also it worksbundledoc --exclude=texlive test.tex– student Jan 11 '19 at 13:56