I have the following situation:

Like most LaTeX users that write much, I have my own header files where the packages I use normally are required and the macros I use often are defined.

So if I write some article, I will normally use my own macros and save a lot of time and redundancies.

Now I send in my article to some journal and they want to publish it! Of course they want me to send in my source code.

Naturally, the following problem arises: The publishers won't want to include my own headers. They want code that compiles on every regular TeX-distribution. How can I convert my source into a file that doesn't contain my own macros anymore?

I need something like a preprocessor, that "inlines"/expands all macros and definitions found in the headers I explicitly specify (my headers), but not those in the other, unmentioned packages (regular headers).

Does anything like this exist? Could it be implemented using TeX/LaTeX or would one have to reimplement the macro expansion mechanism?


1 Answer 1


Take a look at arlatex or bundledoc. They are both scripts that are contained in the TeXLive distribution. They could do the job you need.

  • 1
    Thanks for your contribution. I added the usual hyperlinks to CTAN. However, these packages seem to bundle all required files together, which might be an alternative solution to the problem, but isn't exactly what was asked. Jul 5, 2011 at 13:57
  • @Turion : I got the TL2011 pretest on a linux machine, and arlatex IS included in the distribution. Please, try arlatexin a terminal, texdoc arlatex to read the documentation.
    – Sam Qasbah
    Jul 5, 2011 at 14:49
  • 1
    @Martin Sharrer : Yes, it's a working workaround to the problem; mainly arlatex is an alternative very close to the solution.
    – Sam Qasbah
    Jul 5, 2011 at 14:52
  • While bundledoc automatically detects dependencies, it doesn't bundle everything up in one tex file. Arlatex does this, making it very convenient when you have to upload a single tex file to an automated tex document server (arxiv or similar), but you have to determine the dependencies yourself. Still, great hint!
    – Turion
    Aug 2, 2013 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.