Tell me more ×
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 tex files, tex1 and tex2. I want to include tex1 into tex2. I know \include and \input but those won't allow to include tex files with own formatting. tex1 has a header for example but tex2 doesn't, documentclass and used packages are also different. When I simply copy the content of tex1 into tex2 it will format with my formatting options but I want to keep those of tex1.

Is there an environment that will let me change formatting options inside but won't affect anything that is outside?

share|improve this question
what do you mean by "formatting"? page style, page margins, ...? – Herbert Jan 13 at 12:58
1  
Welcome to TeX.SX. – Claudio Fiandrino Jan 13 at 13:13
Hi. Documentclass, packages, textwidth etc. are different in tex1. Sorry for my english maybe I used the wrong word. – Tilman Jan 13 at 13:21
1  
It sounds as if you want to combined two documents which have different class options set without having to alter the settings part-way through. Depending on the detail of the problem, I'd either consider using the combine class or combining the typeset PDFs for example using pdfpages. A bit more detail would help work out which route you are after. – Joseph Wright Jan 13 at 14:03
2  
Tilman: Note that pdfpages, as suggested by @JosephWright, also allows to add page numbers and headings from the main document. You need to clear the pagecommand setting for this. Also, have a closer look to the suggested combine package. It might be just what you want. – Martin Scharrer Jan 13 at 16:12
show 3 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.