# TeX capacity exceeded, sorry [input stack size=5000]. \begin{figure}[h]

I have found similar errors posted but none related to the figure command. I am trying to show a figure in my Latex template, if I remove the \begin{figure}[h] block, my file runs OK, but currently I cannot show any figure. The files I have are:

Main.tex

\documentclass[12pt,PhD,twoside]{muthesis}
\usepackage{CJKutf8}
\usepackage[doublespacing]{setspace}
\usepackage{tocloft}

\renewcommand\cftsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsecafterpnum{\vskip\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip\baselineskip}

\begin{document}
\title{Title}
\author{Author}
\school{School name}
\faculty{Faculty}
\def\wordcount{xxxxx}

\beforeabstract
\input{abstract}
\afterabstract
\prefacesection{Acknowledgements}
\afterpreface

\chapter{Introduction}
\input{chapter1}
\chapter{Background}
\chapter{Conclusions}

\begin{thebibliography}{999}
\bibitem{ANO} A.N.~Other, ....
\end{thebibliography}

\appendix
\chapter{A Long Proof}

\end{document}


abstract.tex

\begin{singlespace}
This is the abstract.
\end{singlespace}


chapter 1.tex

This is a ref to Figure 1 below.

\begin{figure}[h]
\centering
\includegraphics[width=0.7\linewidth]{figure1}
\caption{Caption}
\label{fig:figure1}
\end{figure}


Other errors:

chapter1 - TeX capacity exceeded, sorry [input stack size=5000]. \begin{figure}[h]

abstract - Underfull \hbox (badness 10000) in paragraph

chapter 1 - Underfull \vbox (badness 10000) has occurred while \output is active []

The errors above disappear if I remove the \begin{figure}[h] block but I need to put figures.

Thank you for any help.

The class I am using is here.

• The files are shown there :) Files are "chapter1" and "abstract" – User2130 Apr 13 '18 at 11:52
• If you copy and past the files as they are shown there. The error appears. The contents shown in chpater1.tex and abstract.tex is all I have inside those. – User2130 Apr 13 '18 at 11:54
• Sorry, I will edit to include the class file which is the only missing thing – User2130 Apr 13 '18 at 11:59
• oh that is a different muthesis to the one in texlive (look at line 25:-):-) – David Carlisle Apr 13 '18 at 12:09
• the one in texlive was edited by Graham 2011 %% Time-stamp: <2011-08-25 16:41:19 grahamgough> The one you are using is dated 2013 but based on an ancient version of Graham's %% Time-stamp: <July 23, 1997 11:33:00 BST graham@zzzzz> and seems to be basically broken. I would use the muthesis that is in texlive and add graphicx package and hyperref. – David Carlisle Apr 13 '18 at 12:15

%% Time-stamp: <2011-08-25 16:41:19 grahamgough>

%% Time-stamp: <July 23, 1997 11:33:00 BST graham@zzzzz>

and seems to be basically broken. I would use the muthesis.cls that is in texlive and add graphicx package and hyperref in your preamble.