4

This question already has an answer here:

How can I found out which packages cause problems with the class svjour3?

After many compilations I found out that the problem lies in of the packages I use. The code is below and does not produce a pdf.

EDIT 1: The file svjour3.cls was modified on 1/10/2008. I use MiKTeX 2.9.

EDIT 2: The error is

! TeX capacity exceeded, sorry [input stack size=5000].
\cl@chapter ->\cl@chapter 
                          \@elt {theorem}
l.2486 }{}
          %  end of \@ifpackageloaded{amsmath}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on probleem.log.

PDFLaTeX Compilation Report:

(Pages: 0) Errors: 2   Warnings: 2   Bad Boxes: 0



\documentclass[smallextended]{svjour3}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{undertilde}
\usepackage{amstext}
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage{graphics}
\usepackage{color}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{float}
\usepackage{subfigure}
\usepackage[sort&compress,round,comma,authoryear]{natbib}%bibtex
\usepackage{mathtools}
\usepackage{epstopdf}
\usepackage[titletoc,title]{appendix}% for appendix met A
\usepackage{cleveref}
\usepackage{dcolumn}


\begin{document}
Hello
\end{document} 

marked as duplicate by Stefan Pinnow, Martin Schröder, Maarten Dhondt, Schweinebacke, Mico Apr 13 '17 at 6:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Well, which TeX distribution do you use, is it up to date, which version number has class svjour and important which error message did you get? Please add theese infos to your question! – Mensch Aug 31 '16 at 18:14
  • The file svjour3.cls was modified on 1/10/2008. – Nadori Aug 31 '16 at 18:23
  • 1
    Please add a link to that version you use. As far as I know is the last version from springer defined with: \ProvidesClass{svjour3}[2007/05/08 v3.2 ... – Mensch Aug 31 '16 at 18:31
  • See (ctrl + f 'latex macro package') springer.com/?SGWID=0-102-6-791955-0 – Nadori Aug 31 '16 at 18:36
  • 2
    Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Jan 6 '17 at 16:49
11

The problem appears when cleveref is being loaded and it shows only when amsmath is loaded, because in this case cleveref does some checks and redefinitions.

The issue is an error in svjour which does

\if@envcntsect
   \def\@thmcountersep{.}
   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
\else
   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
   \if@envcntreset
      \@addtoreset{theorem}{section}
   \else
      \@addtoreset{theorem}{chapter}
   \fi
\fi

and the \@addtoreset{theorem}{chapter} line makes no sense whatsoever, as the class doesn't support chapters.

You can fix this by defining a dummy chapter counter.

\documentclass[smallextended]{svjour3}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
%\usepackage{undertilde} % not in TeX Live
%\usepackage{amsthm} % incompatible with svjour3
%\usepackage{epsfig} % obsolete
%\usepackage{graphics} % loaded by graphicx
\usepackage{color}
\usepackage{booktabs}
\usepackage{graphicx}
%\usepackage{caption} % incompatible with svjour3
\usepackage{float}
\usepackage{subfigure} % deprecated!!!
\usepackage[sort&compress,round,comma,authoryear]{natbib}%bibtex
\usepackage{epstopdf}
\usepackage[titletoc,title]{appendix}% for appendix met A
\usepackage{dcolumn}
\newcounter{chapter} % to fix the bug in svjour3
\usepackage{cleveref}

\begin{document}

Hello

\end{document}

I have commented out some packages: undertilde is not on my system, probably you're better served with the accents package (remember to load it after amsmath); the others I commented are either obsolete or incompatible with svjour3 (besides some raising errors).

Instead of subfigure you can use

\usepackage[caption=false]{subfig}

which has \subfloat instead of \subfigure and \subtable (an easy change).

Not the answer you're looking for? Browse other questions tagged or ask your own question.