# Can't compile minimal document class? [duplicate]

I'm trying to compile a gnuplot epslatex output (which contains a .tex and .eps file). When I use

\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\input{temp.tex}
\end{document}


I get the error

) (C:\Users\Stefan\Documents\temp.tex

! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.2 \documentclass
{minimal}
?


The temp.tex file output by gnuplot has documentclass{minimal}, so my document can't run minimal classes for some reason, why is that?

## marked as duplicate by Adam Liter, jub0bs, egreg, Jesse, Martin SchröderMay 11 '14 at 22:59

• You can not \input a complecte TeX file with \documentclass – Ma Ming May 11 '14 at 21:24
• You must either use set terminal epslatex standalone and compile the resulting document, or use only set terminal epslatex and then you can include the image file with \input{myimage} in an other document. – Christoph May 12 '14 at 12:49