0

I have several .tex files that I would like to share with other people. I've included in them (with the command \input) several files with macros that I've written myself. However, I would like to send only a self-contained .tex file.

What I need to do is generating another .tex file where the \input command is replaced with the content of the file, pretty much like you would do by calling just the preprocessor in C.

I guess this could be done (relatively) easily with a bit of scripting, but I would like to know if there were a builtin option in a LaTeX compiler.

Mauro F.
  • 113
  • 2
    no (there are existing answers on site about this) latex never holds the source in memory or constructs the combined file. – David Carlisle Mar 09 '19 at 10:40
  • @DavidCarlisle so you're saying that I have to do it by myself? – Mauro F. Mar 09 '19 at 10:41
  • https://tex.stackexchange.com/questions/474203/build-one-single-tex-file-from-a-tex-file-with-multiple-input?r=SearchResults&s=1|42.4971 https://tex.stackexchange.com/questions/25713/how-do-i-combine-several-tex-files-into-one/25747?r=SearchResults&s=6|20.5910#25747 https://tex.stackexchange.com/questions/184152/make-a-standalone-version-of-multiple-files-all-document-in-one-tex-file/184585?r=SearchResults&s=8|15.0726#184585 etc – David Carlisle Mar 09 '19 at 10:42
  • 1
    I'm saying latex won't do it, but there are lots of tools that do (or claim to do) this for you. (it is trivial to write a few lines of perl to do this on any normal document, writing a general tool that gets it right on any document and copes with the string \input in verbatim or comments etc is trickier but usually not needed) – David Carlisle Mar 09 '19 at 10:44

0 Answers0