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.

In one of my documents, the first few (lets say 2) pages include code output and settings and configurations, in terms of communicating with R for example (for plotting etc...), I would like these pages to appear at the rear of the document, or split off into a second document.

They need to be 'typeset' in the original order, since much of the appearance of the document thereafter, is dependent on what is defined in this pre-section. The actual contents of the output to the pre-section, however, is trivial to the reader of the actual document, however, of interest to me.

How can I re-arrange or split the document post typesetting, to either remove the first 2 pages into a new document, or, move them to the end of the current document.

share|improve this question
    
have you looked at the pdfpages package? –  cmhughes Dec 20 '12 at 3:08
1  
Can you be more precise as to what in those "pre-sections" is relevant for the following material? –  egreg Dec 20 '12 at 7:35

2 Answers 2

up vote 0 down vote accepted

This solves the question...

\AtEndDocument{
   %Add Content
}
share|improve this answer

Not sure if I understood your problem but if the first couple pages are just settings, you could create an .sty file, say mysettings.sty, with all your customizations and in the original document replace the first couple pages with \usepackage{mysettings}.

share|improve this answer
    
I'm not sure that will work here. The settings are actually 'R' settings, not latex settings, they are defined at runtime from inside \begin{document} \end{document} to define the 'R' environment, certain output is returned, and that output is what is being inserted into the document. I want the output, so I can refer back to it later in version control. It needs to be done at the start, but I want the output to be put at the end (or in a separate file) –  Nicholas Hamilton Dec 20 '12 at 0:57
    
@ADP Have you thought about using the commands \AtBeginDocument and \AtEndDocument? –  mkota Dec 20 '12 at 3:13
    
@Jay, that solved my problem. If you want to post as a complete answer, I'll mark it as a solution... –  Nicholas Hamilton Dec 20 '12 at 3:30

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.