[comp.text.tex] Expanding \input, \include to obtain single file

hgschulz@.cs.umass.edu (Henning Schulzrinne) (01/15/91)

When shipping TeX and LaTeX files to others which may or may not have
the same operating system (and file naming convention) and probably no
access to all style files used, it would be helpful to "expand" or merge
all input, includes and documentstyle options to generate a single file.
In other words, each input, include, etc. would be replaced by the file
contents it references. A crude approach is to use SED on Unix to
convert \include and \input to #include's and then run the C
preprocessor across the root file, but that still does not handle the
style files (and has other problems). Is anybody aware of easier
alternatives?

Henning Schulzrinne
University of Massachusetts

ken@csis.dit.csiro.au (Ken Yap) (01/15/91)

>When shipping TeX and LaTeX files to others which may or may not have
>the same operating system (and file naming convention) and probably no
>access to all style files used, it would be helpful to "expand" or merge
>all input, includes and documentstyle options to generate a single file.
>In other words, each input, include, etc. would be replaced by the file
>contents it references. A crude approach is to use SED on Unix to
>convert \include and \input to #include's and then run the C
>preprocessor across the root file, but that still does not handle the
>style files (and has other problems). Is anybody aware of easier
>alternatives?

I'd be careful with the C preprocessor, if you have the word "unix" in
the input you may find it replaced by 1. Also unbalanced quotes, etc
will make strict cpps grumble.

Kamal Al-Yahaya's textools contains a texexpand if I remember
correctly.  I don't think it does sty files, but maybe a sed script in
front will fix that. Where: uunet.uu.net:comp.sources.unix at least.