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 two aux files attached to my LaTeX document : aux_1 and aux_2. I would like, at some point, to copy the content of aux_1 to aux_2.

More precisely, the file aux_1 does already contain some text. I want to copy the content of aux_2 after the already existing text.

Is it possible to do it ? I use the newfile package to deal with the aux files.

PS : If possible, I would like a LaTeX-friendly answer :)

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
\write18{cp aux_1 aux_2}

(On Windows, use copy instead, I think.)

share|improve this answer
2  
\immediate\write18 if the command needs to be performed at a precise moment; without \immediate it will be deferred to the next shipout operation (that might never happen). –  egreg Oct 14 '11 at 9:29
    
@egreg: Good advice, though that makes my answer more serious than I intended it. I'm just pushing my "why do that in LaTeX when you have a perfectly good OS instead" angle on excessive TeX programming. –  Ryan Reich Oct 14 '11 at 14:45
1  
I suspect that your proposition will overwrite aux_1 to aux_2. –  Colas Oct 18 '11 at 15:56
1  
@Colas: Yes, it will. You can use a different operating system utility that will append them, e.g. cat, if you want that. As I said, my point is that this is not a TeX task and the solution is to use \write18 to farm it out to the system. –  Ryan Reich Oct 18 '11 at 16:38
    
Thanks ! I understand that I do strange things, sorry about that :) –  Colas Oct 18 '11 at 16:41
add comment

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.