# How to include a tex file with own formatting options

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?

-
what do you mean by "formatting"? page style, page margins, ...? –  Herbert Jan 13 '13 at 12:58
–  Claudio Fiandrino Jan 13 '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 '13 at 13:21
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 '13 at 14:03
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 '13 at 16:12

Combining two documents which have different class options set can be done in a couple of ways. I'd either consider using the `combine` class or combining the typeset PDFs for example using `pdfpages`. It is possible to change page dimensions and settings mid-document, but this is tricky and LaTeX doesn't encourage it as it tends to be poor design. (A bit more detail would help work out which route you are after.)