# Including .tex file to LyX document

Is it possible to write pure latex to a separate file and then include that in the LyX document. What are the pros and cons of doing that? As far as I understand there are problems with preamble. Basically what I would like to do is this - write a table to separate latex file and then include that in the document (I would be great if document header and footer came from LyX document.

-

Go to Insert > File > Child Document. See the section "7.2 Child Documents" in the Help > Embedded Objects manual. It explains how to insert `.lyx` files, `.tex` files, and `.txt` files (verbatim).
You can use `\input{foo.tex}` or `\include{foo.tex}` to insert files containing only body text. But these two commands are different. Look for the difference.
While it would be possible to write `\input{...}` or `\include{...}` commands into an ERT box, they would usually fail (if relative paths are used, which is good practice), as LyX generates and compiles everything inside a temporary folder. Hence, the mechanism built into LyX, described by scottkosty, is preferable. However, the point is that the answer, as given, is not really helpful anyway: It does not address the OPs issue and instead of writing "Look for the differences" it would be better to describe them briefly. – Daniel Feb 14 '13 at 14:24