4

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} 
Schweinebacke
  • 26,336
Nadori
  • 1,865

1 Answers1

12

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).

egreg
  • 1,121,712