# I can't load tikz package

I am writing an article in a multifile project. I use an external template provided by the organisor. I want to use some tikz pictures. I can load other packages at the beginning of my file, but loading {tikz} gives errors:

! Undefined control sequence. \@enddocumenthook ... \ifpgf@external@grabshipout \pgfutil@ifundefined {pgfe... l.22 \end{document} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g.,I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Extra \fi. \@enddocumenthook ...rnal@error@no@shipout }{}\fi l.22 \end{document} I'm ignoring this; it doesn't match any \if.

[2]

The main file:

\documentclass[12pt,final,reqno,twoside,packages]{combine}
\usepackage{combinet}
\renewcommand{\toctitlefont}{\normalsize}
\renewcommand{\tocauthorfont}{\normalsize}
\setlength{\toctitleindent}{1.5em}
\setlength{\tocauthorindent}{0em}
\input{preamble.tex}

\title{}
\author{}
\date{}
\bigFoot

\begin{document}

\begin{papers}
\pagestyle{fancy}
\setcounter{theorem}{0}
\import{...}
\end{papers}

\end{document}


My file:

\usepackage{tikz}
\begin{document}
\selectlanguage{english}
\title{Lecture Title}
\author{Name Surname}
\affilation{
...
}
\smallFoot
\maketitle

\bigFoot
\end{document}


Without \usepackage{tikz} it does not return any error.

What can I do to fix it?

I suppose this is sth like this: http://latex-community.org/forum/viewtopic.php?f=4&t=5372 but it still does not improve my situation.

• Where is your file loaded in the main file? And try to put \usepackage{tikz} in the main file before \begin{document}. – Dr. Manuel Kuehner Sep 4 '15 at 17:41
• My file is loaded between \import{...} - I removed the name of the file intentionally. It is loaded properly if I don't try to load tikz package. Unfortunately, I can't modify the main file. I can only add additional packages at the beginning of my file. And loading other packages works, there is a problem only with tikz. – silver Sep 5 '15 at 11:04
• Anyway putting \usepackage{tikz} in the main file before \begin{document} also gives an error: ! TeX capacity exceeded, sorry [input stack size=5000]. – silver Sep 5 '15 at 11:19