# TeX capacity exceeded on template

I am new to LaTeX and am currently working on a thesis. I was sent a template to create the thesis with so I assume that it works on other configurations. I installed MikTex and told it to install packages "on the fly". To edit I use Texniccenter .Below is the error message I am getting, if I click on the error it directs me to a file 'english.ldf' Do you have an idea what I can do to fix this? As suggested in other threads I already reinstalled babel-english

* Local config file bblopts.cfg used
*
(C:\Users\nletm\AppData\Roaming\MiKTeX\2.9\tex\latex\arabi\bblopts.cfg
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to \errhelp {Use  for a simple double quote character.}\errmess
age {ngerman: The command "d is undefined}declaredöptions of babel
)
("C:\Program Files\MiKTeX 2.9\tex\latex\babel-english\english.ldf"
Language: english 2017/06/06 v3.3r English support from the babel system

("C:\Program Files\MiKTeX 2.9\tex\generic\babel\babel.def"
File: babel.def 2018/09/02 3.23 Babel common definitions
\babel@savecnt=\count113
\U@D=\dimen164
("C:\Program Files\MiKTeX 2.9\tex\generic\babel\txtbabel.def")
\bbl@dirlevel=\count114
)
! TeX capacity exceeded, sorry [input stack size=5000].
\@ifundefined #1->\ifcsname #1
\endcsname \@ifundefin@d@i \else \@ifundefin@d...
l.47 \LdfInit\CurrentOption{date\CurrentOption}

If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

Here is how much of TeX's memory you used:
13991 strings out of 492972
281744 string characters out of 3135884
855513 words of memory out of 3000000
17648 multiletter control sequences out of 15000+200000
4702 words of font info for 16 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
5000i,1n,3749p,9088b,137s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!


EDIT: Thank you for helping me, here is an anonymized full code, note that the chapters are added externally

\documentclass{thesisclass}
% Based on thesisclass.cls of Timo Rohrberg, 2009
% ----------------------------------------------------------------
% Thesis - Main document
% ----------------------------------------------------------------

%% ---------------------------------
%% | Information about the thesis  |
%% ---------------------------------
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{multirow}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{tikz}
\usepackage{array}
\usepackage{scrhack}
\usepackage{listings}
\usepackage{pdfpages}
\usepackage{placeins}
\usepackage{textcomp}
\usepackage[raiselinks=true, bookmarks=true, bookmarksopenlevel=1, bookmarksopen=true, bookmarksnumbered=true, hyperindex=true, plainpages=false,

\definecolor{light-gray}{gray}{0.95}
\definecolor{dark-gray}{gray}{0.7}

\lstset{linewidth=\textwidth, showstringspaces=false}
\lstset{numbers=left, stepnumber=5, numbersep=10pt, tabsize=2}
\lstset{frame=trBL}

%% -------------------------------
%% |  Information for PDF file   |
%% -------------------------------
\hypersetup{
pdfauthor={Not set},
pdftitle={Not set},
pdfsubject={Not set},
pdfkeywords={Not set}
}

%\mathcode,="013B
%\mathcode.="613A

\makeatletter
\def\@endtheorem{\endtrivlist} % insert \qed macro
\makeatother

\renewcommand{\proofname}{Proofs}

%\DeclareSymbolFont{calsym}{OMS}{ztmcm}{m}{n}
%\DeclareSymbolFontAlphabet{\mathcal}{calsym}

\newtheoremstyle{break}  % follow plain defaults but change HEADSPACE.
{\topsep}   % ABOVESPACE
{\topsep}   % BELOWSPACE
{\itshape}  % BODYFONT
{0pt}       % INDENT (empty value is the same as 0pt)
{\newline}  % HEADSPACE. plain default: {5pt plus 1pt minus 1pt}
\theoremstyle{break}
\def\@endtheorem{\endtrivlist}
\newtheorem{definition}{Definition}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{example}{Example}[chapter]

\newcommand{\mycourse}{Industrial Engineering}
\newcommand{\myname}{Max Mustermann}
\newcommand{\mytitle}{Topic}
\newcommand{\myinstitute}{Institutue of Science}
\newcommand{\mychair}{Chair ofTheory}

\newcommand{\reviewerone}{Prof. Smith}
\newcommand{\reviewertwo}{optional} %Kann in titlepage.tex eingeblendet werden
\newcommand{\advisortwo}{optional} %Kann in titlepage.tex eingeblendet werden

\newcommand{\timestart}{January 1st, 2015}
\newcommand{\timeend}{January 2nd, 2015}
\newcommand{\submissiontime}{January 2nd, 2015}

\definecolor{light-gray}{gray}{0.9}

\DeclareMathOperator*{\argmin}{arg\,min}

%% --------------------------------
%% | Settings for word separation |
%% --------------------------------
% Help for separation:
% In german package the following hints are additionally available:
% "| = Suppress ligation and possible separation (e.g. Schaf"|fell)
% "~ = Hyphenation without separation (e.g. bergauf und "~ab)
% "= = Hyphenation with separation before and after
% "" = Separation without a hyphenation (e.g. und/""oder)

% Describe separation hints here:
\hyphenation{
Dis-kont-ra-ten
% Pro-to-koll-in-stan-zen
% Ma-na-ge-ment  Netz-werk-ele-men-ten
% Netz-werk Netz-werk-re-ser-vie-rung
% Da-ten-strom-spe-zi-fi-ka-tion Pa-ket-rumpf
% Kon-troll-in-stanz
}

%% ------------------------
%% |    Including files   |
%% ------------------------
% Only files listed here will be included!
% Userful command for partially translating the document (for bug-fixing e.g.)
\includeonly{%
titlepage,
Kapitel/kap1,
Kapitel/kap2,
Kapitel/kap3,
Kapitel/kap4,
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Here, main documents begins %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

% Remove the following line for German text
\selectlanguage{english}

\frontmatter
\pagenumbering{roman}
\include{titlepage}
\blankpage

\clearpage\thispagestyle{empty}
\setmarginsrb{25mm}{2cm}{35mm}{2cm}{6mm}{7mm}{5mm}{15mm}
\begin{center}\textbf{\large Erk{\"a}lrung}\end{center}

\noindent
Sampletext \\
\noindent

City, xx.xx.xxxx \\
\\ \\ \\ \\ \\
%\begin{figure}[H]
%\includegraphics[width=60mm]{logosBilder/Unterschrift.jpg}
%\end{figure}
------------------------------------------------------\\
Sample Name

\blankpage
%% -------------------
%% |   Directories   |
%% -------------------
\tableofcontents
\listoffigures
\listoftables

%% -----------------
%% |   Main part   |
%% -----------------
\mainmatter
\pagenumbering{arabic}
\onehalfspacing
%\include{Kapitel/Grundlagen}
\include{Kapitel/kap1}
\include{Kapitel/kap2}
\include{Kapitel/kap3}
\include{Kapitel/kap4}
%% --------------------
%% |   Bibliography   |
%% --------------------
\cleardoublepage
\phantomsection

\bibliographystyle{babalpha-fl} % german style

% Use IEEEtran for numeric references
%\bibliographystyle{IEEEtranSA})

\bibliography{thesis}

%% ----------------
%% |   Appendix   |
%% ----------------
\cleardoublepage
\input{appe}

\end{document}

• Welcome to TeX.SE. Excuse me but what is your code that produce several errors? Peraphs there is any error on fontenc/babel. – Sebastiano Sep 5 at 10:49
• – Fran Sep 5 at 10:52
• Thank you both for your comments, I sadly don't have a choice whether I use the template or not as it is required and incorporates the exact citation style etc. which is required by the institute I work for. Sebastiano I am not completely comfortable posting the full template here as it is a more or less internal document. Are there good ways for me to tackle this and track what the problem is? Thank you for your welcoming words! – NikNet Sep 5 at 11:04
• As long as you do not provide any code, we cannot help. This could be al sorts of stuff. Sorry. – daleif Sep 5 at 11:11
• try to make a test file, start from a copy of your real document and delete everything not needed to generate the error. The error appears to be in the package loading so presumably none of the document body is needed for example. you may also try putting \RequirePackage[2017-01-01]{latexrelease} as the first line of your document. – David Carlisle Sep 5 at 11:57