[texhax] "tex project file collector" or anything alike?

Steve Schwartz s.schwartz at imperial.ac.uk
Wed Oct 26 16:55:36 CEST 2011


Ralph,

On Tue, 2011-10-25 at 16:04 +0200, ralph buse wrote:
> So I am looking for a tool which
> figures out about and collects the used files in the sense that the
> tex / eps files are actually required to assemble / produce the actual
> / current version of the document. and e.g. copies them into another
> fresh folder tree keeping the structure.

I wrote some time ago a cshell script to bundle up a latex project. The
idea was to be able to give someone everything they needed to latex my
source, despite the fact that files and figures and such were pulled in
from various directories. It didn't preserve such a folder tree (since
in my case, for example, images were scattered all over my hard-drive),
but since everything was dumped in a single directory it guaranteed the
result would run. It also included any special latex packages, etc.,
based on searching through my base latex distribution to see if the
package was there.

I attach that script. If you don't speak C-shell, most of it might be
gibberish, but I think the comments describe the logic which, in any
case you would need to adapt.

To cut to the chase, the core of it is to call latex with a -recorder
option, e.g.,

latex -recorder source.tex

This generates a file source.fls which contains a list of all the files
used by latex, including class, packages, images, includes, inputs,
etc., etc. The rest of the script simply squirts that file through some
editor filters to generate a list, and ultimate a little job, that packs
up the text.

If you start from the -recorder output file, you would probably be a
long way to seeing what a given source.tex used and might be able to
construct something similar relatively easy. Depends on your platform
and experience. I'd guess, for example, that perl would be better than
C-shell.

HTH
Steve
-- 
+-------------------------------------------------------------------+
Professor Steven J Schwartz        Phone: +44-(0)20-7594-7660
Head, Space & Atmospheric Physics  Fax:   +44-(0)20-7594-7772
The Blackett Laboratory            E-mail: s.schwartz at imperial.ac.uk
Imperial College London            Office: Huxley 6M67A 
London SW7 2AZ, U.K.               Web: www.sp.ph.ic.ac.uk/~sjs
+-------------------------------------------------------------------+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: packngotex.sh
Type: application/x-shellscript
Size: 3123 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20111026/74bcce7a/attachment.bin>


More information about the texhax mailing list