# Using \include with in Tabular / Array

I'm doing graphics using PStricks, writing each figure in it's own sub-file. I would like to order two of these figure vertically with a symbol in between.

To that end, I've tried using a tabular and arrays environments. This, however, produces and error, even when the sub-file is empty.

For PStricks, I compile using xelatex on Ubuntu.

A minimal working example is

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{tabular}{ccc}
\include{test} & b & c\tabularnewline
\end{tabular}

\end{frame}
\end{document}


Here, the error is produced at \end{frame}. test.tex is empty and is in the same folder as the main file.

Is there away to solve this problem?

-
Try \input instead of \include, see e.g. tex.stackexchange.com/questions/246/… –  Torbjørn T. Aug 14 '12 at 10:32
Wonderful! Thank you very much! I wish you had answered this, so I could have accepted it! –  Rasmus Aug 14 '12 at 13:36

## 1 Answer

Use \input{test} instead of \include{test}. The former gives the same as typing the contents of test.tex into your main file, while the latter inserts \clearpage before and after, as well as doing some trickery to write a separate .aux file for each included file.

\include is useful for e.g. the case where you divide a text into chapters, with one chapter in each file, but for cases such as this, where you want to put the code for a pstricks drawing in a separate file, \input should be used.

For more details see When should I use \input vs. \include?

-