Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
I found a very related question: tex.stackexchange.com/questions/3174/latex-macro-expander –  Turion Jul 4 '11 at 14:52
    
Depending on how smart your macros are, some of them could just be find/replaced with sed or similar tool... –  Seamus Jul 4 '11 at 15:27
3  
You don't need to expand your macros, you just need to include the style file(s) in the preamble. Take a look at: tex.stackexchange.com/questions/12554/… for some ideas on how to do this. –  Loop Space Jul 4 '11 at 16:09
    
@Turion: I can't see why it is really related, especially the accepted answer there doesn't work here at all. –  Martin Scharrer Jul 5 '11 at 14:05
2  
Sorry to dredge up an old post, but this SO post should be linked: stackoverflow.com/questions/17793815/…. –  Sean Allred Aug 1 '13 at 14:52

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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. –  Martin Scharrer Jul 5 '11 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 '11 at 14:49
    
@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 '11 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 '13 at 11:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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